ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Getting a "Read-Only" error (https://www.excelbanter.com/excel-programming/420575-getting-read-only-error.html)

Mac Lingo

Getting a "Read-Only" error
 
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



Jim Cone[_2_]

Getting a "Read-Only" error
 

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



"Mac Lingo"

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




All times are GMT +1. The time now is 07:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com