|
-
Dec 13th, 2005, 02:11 PM
#1
Thread Starter
Addicted Member
[RESOLVED] saveAs Export not working
objWorkbook.SaveAs FileName:="C:\Test.txt", FileFormat:=xlText
This is not working for me.
I get SaveAs method of workbook failed (1004)
I changed x|Text to one of many wdformats they fail too. ex(wdFormatDOSTextLineBreaks )
i need to export the spread sheet after making changes to a tab delimited file.
thanks.
-
Dec 13th, 2005, 02:28 PM
#2
Re: saveAs Export not working
Can you save it in any format at all using this code? Even a format you aren't interested it? Is there some problem with using the filename you have chosen?
zaza
-
Dec 13th, 2005, 02:40 PM
#3
Thread Starter
Addicted Member
Re: saveAs Export not working
no formats work. filename is temp.txt. if i leave off FileFormat:=xlText then is saves it with the new file name only not readable in notepad obviously.
-
Dec 13th, 2005, 02:56 PM
#4
Thread Starter
Addicted Member
Re: saveAs Export not working
I'm gonna mark this resolved. looks like i have to use this:
objWorkbook.SaveAs FileName:="C:\Test.txt", FileFormat:=3
i was not setting the constants. thanks for your help. any further info on this will still be helpful.
-
Dec 13th, 2005, 04:09 PM
#5
Frenzied Member
Re: [RESOLVED] saveAs Export not working
Hmmmm ... typical MegaShaft SNAFU. Here are some of the significant enumerations from '2003 xlFileFormat Class Members in the Object Browser(Hit <F2>). Of course, "3" is missing!
Code:
Debug.Print "xlSYLK", xlSYLK
Debug.Print "xlWKS", xlWKS
Debug.Print "xlWK1", xlWK1
Debug.Print "xlCSV", xlCSV
Debug.Print "xlDBF2", xlDBF2
Debug.Print "xlText", xlText
Debug.Print "xlTextMac", xlTextMac
Debug.Print "xlTextMSDOS", xlTextMSDOS
Debug.Print "xlTextWindows", xlTextWindows
Debug.Print "xlTextPrinter", xlTextPrinter
Debug.Print "xlUnicodeText", xlUnicodeText
Debug.Print "xlAddIn", xlAddIn
Debug.Print "xlCSVMac", xlCSVMac
Debug.Print "xlCSVMSDOS", xlCSVMSDOS
Debug.Print "xlCSVWindows", xlCSVWindows
Produces the following table:
Code:
xlSYLK 2
xlWKS 4
xlWK1 5
xlCSV 6
xlDBF2 7
xlText -4158
xlTextMac 19
xlTextMSDOS 21
xlTextWindows 20
xlTextPrinter 36
xlUnicodeText 42
xlAddIn 18
xlCSVMac 22
xlCSVMSDOS 24
xlCSVWindows 23
How did you find that "3" works?
Blessings in abundance,
All the Best,
& ENJOY!
Art . . . . Carlisle, PA . . USA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|