Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

saving a READ ONLY file

Status
Not open for further replies.

vzachin

Technical User
Feb 10, 2006
305
US
hi
i have a read-only file that i'm trying to save but i'm getting an error message
"object value is set to nothing"

Code:
        Dim xl As Object, xl_workbook As Object, xl_sheet As Object
        Set xl = CreateObject("excel.application")
        xl.Visible = True
        xl.Workbooks.Open Filename:="xxx.CSV"
        [blue]xl_Workbook.saveas "C:\TestFile\test.xls"[/blue]

any ideas?

thanks
zach
 



Zach,

Why not write this procedure in Excel VBA?

I would not OPEN a .csv file directly.

Rather, I would IMPORT into an empty sheet in a workbook, using Data > Import External Data....

You will have much more control over PARSING the data properly, especially if you have dates, or text columns containing some numbers.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top