HELP, macro works at work not at home on save as Mac Text

J

Janis

I took my spreadsheet home over the weekend to finish it for work on Monday.
At work I can run this macro without problem. It doesn't like saving as a
text file. The history of this problem is without both saves it saves the
original and turns it into a text file.
It somehow worked by incorporating both saves. It saved both files a text
file and a copy without harming the origina at work.
Now it is saving the file I want as text within the original file on Sheet1.
It doesn't even look like a text file. It looks like it just renamed the
sheet1 as the Indesign text file. At work it was saving two copies of the
original in my Mac OS X root directory which is what I want it to do. It
doesn't compile on the first save.
TIA,

-------



Sub saveIndesign()
'Appends date to filename so as to not write over an existing file

' saveIndesign Macro

Const fPath As String = "Mac OS X:"
Const fName As String = "Indesign"
Const fName1 As String = "SSP"






'do the save first as a txt file


ActiveWorkbook.SaveAs Filename:=fPath & fName & Format(Now,
"yyyymmdd_hhmmss") & ".txt", FileFormat:=xlTextMac


'then save as a normal workbook or the existing file will be changed to a
text file which is not what you want

ActiveWorkbook.SaveAs Filename:=fPath & fName1 & Format(Now,
"yyyymmdd_hhmmss") & ".xls", FileFormat:=xlWorkbookNormal

MsgBox "File Saved to " & fName & fName1 & fPath & Format(Now,
"yyyymmdd_hhmmss")
End Sub
 
J

Janis

Its working now, sorry, every once it awhile it does write over the sheet1
name. i should write an error message in case that happens. thanks anyway.
 

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