Getting a "Read-Only" error

M

Mac Lingo

I am trying to write out from a VBA program a worksheet as a text file. I
have code that use to work, but now doesn't.
Also, when I try to write out the worksheet using <File>,<Save As> a text
file, it works fine. ; no "Read-only" error.

Here's the code:
ActiveWorkbook.SaveAs _
FileName:=TS, _ ' where TS is a valid path/file name
FileFormat:=xlText, _
CreateBackup:=False, _
ReadOnlyRecommended:=False
Any ideas why the VBA code doesn't work?
Mac
 
J

Jim Cone

Try: FileFormat:=xlTextMac
(it sounds like the appropriate one)
--
Jim Cone
Portland, Oregon USA



"Mac Lingo"
<[email protected]>
wrote in message
I am trying to write out from a VBA program a worksheet as a text file. I
have code that use to work, but now doesn't.
Also, when I try to write out the worksheet using <File>,<Save As> a text
file, it works fine. ; no "Read-only" error.

Here's the code:
ActiveWorkbook.SaveAs _
FileName:=TS, _ ' where TS is a valid path/file name
FileFormat:=xlText, _
CreateBackup:=False, _
ReadOnlyRecommended:=False
Any ideas why the VBA code doesn't work?
Mac
 
M

Mac Lingo

Turns out the error was mine: bad file pointer. But...

The file pointer turned out to be to a non-existent disk. Don't know why it
would report a "Read-Only" error, but it did.
Running XP Pro.

Mac
Berkeley, CA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top