View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
J Silver J Silver is offline
external usenet poster
 
Posts: 1
Default activeworkbook.saveas

I found the problem. It turns out that one of the sub folders in my save path was protected. This caused the SaveAs to fail. It did not get a message informing me of the failure. When I put the code in debug mode and looked at Err.Description just after the call, I discovered the problem.

Thanks anyway.

"J Silver" wrote:

Hello,
I am using VBA within Excel 2000. The ActiveWorkBook 'SaveAs' method is working properly. In an older version of my spreadsheet (Excel 2000), the SaveAs method works properly (i.e., if the specified save path/file name is different from the active workbook, a new file is created with the new path/file name and the title bar changes to the new file name). With my spreadsheet, the 'SaveAs' method automatically reverts to lower case (as if it is not recognized as a valid method), the file is saved with the active workbook name, and the title bar does not reflect the new name). Here is the code I am trying to execute. The same code works properly in the older spreadsheet (and 'SaveAs' remains in mixed case).

Original code:
================================
Dim SaveFileName
SaveFileName = "c:\time_sheets\time 2004-06-24"
ActiveWorkbook.SaveAs Filename:=SaveFileName
================================

New code:
================================
Dim SaveFileName
SaveFileName = "c:\time_sheets\time 2004-06-24"
ActiveWorkbook.saveas Filename:=SaveFileName
================================