LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default runtime error 1004 saveas text file

I get a runtime error on the activeworkbook.saveas line.

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

' saveIndesign Macro

Const fPath As String = "Mac OS X:Users:jrough:Documents:"
Dim fName As String
Dim myFileName As String
myFileName = Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) & Date
& ".txt"

fName = fPath & myFileName & time()
ActiveWorkbook.SaveAs Filename:=fName, FileFormat:=19
MsgBox "File Saved to " & fName
End Sub


I checked that the diretory is read/write, the filename & path is under 200
characters, the name isn't already created. That is why I would like the
time appended to the filename and the date.

Thanks,
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent help Runtime error ‘1004’ Method ‘SaveAs’ of object’-Workbook’ failed ????? funkymonkUK[_155_] Excel Programming 4 May 4th 06 12:56 PM
File Name Causes Runtime Error 1004 Robert Excel Programming 1 November 10th 05 02:47 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
SaveAs text file from VBA Getting Error JeepNC Excel Programming 1 January 28th 05 10:20 PM
runtime error 1004 when opening excel file via VBA in a browser Ken Hunter Excel Programming 2 July 31st 03 03:33 PM


All times are GMT +1. The time now is 05:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"