Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
SaveAs text file from VBA Getting Error
I have the following code trying to save an excel sheet as a text file I get
the following error message. Any suggestions? Thanks, Dim xlx As Object, xlw As Object, xls As Object, xlc As Object Set xlx = CreateObject("excel.application") xlx.Visible = True Set xlw = xlx.workbooks.Open("C:\book1.xls") Set xls = xlw.worksheets("sheet1") xls.Columns("K:K").NumberFormat = "0" 'ActiveWorkbook.SaveAs Filename:="C:\Book1.txt", _ ' FileFormat:=xlText, CreateBackup:=False xlw.SaveAs Filename:="C:\Book1.txt", _ FileFormat:=xlText, CreateBackup:=False Here's the error SaveAs method of workbook class failed |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
SaveAs text file from VBA Getting Error
Hi, I am not sure that you used a valid xlfileformat. in the VBA editor
pres 'F2' and search 'xlfileformat'. This will give you the various xlfileformat that are available. HTH--Lonnie M. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
SaveAs wk3 file type error message | Excel Discussion (Misc queries) | |||
SaveAs method error | Excel Discussion (Misc queries) | |||
error message with saveas | Excel Discussion (Misc queries) | |||
SaveAs Error | Excel Programming | |||
Error on SaveAs Macro | Excel Programming |