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: 66
Default SaveAs Crashes

I run an application that opens another file, generates a report, then saves
to another 2 directories. Part of that save is to a historical directory,
then to the "Current" directory. I believe the system is crashing because
there is an existing file in the folder. It creates some LOG then closes
Excel completly.

If I clear the folders then it runs perfectly. The files are created. If i
uncomment the SetAttr line then it gives me a "cannot find file" error and
stops the code.
1) How do I get around the system crash?
2) How do i set file attribute to read only?

I am using:
RptName = ThisPath & "\" & "Reports" & "\ " & RptName & " " & Format(Date,
"yyyymmdd")
Application.DisplayAlerts = False
Application.DisplayAlerts = False
Sheets(ChannelName).Move
ActiveWorkbook.SaveAs Filename:=RptName
' SetAttr RptName, vbReadOnly


 
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
SaveAs - VBA Jae Excel Discussion (Misc queries) 0 April 10th 08 06:04 AM
VBA SaveAs Value charlie Excel Discussion (Misc queries) 4 August 27th 07 11:33 PM
SaveAs Stan Halls Excel Worksheet Functions 5 November 28th 06 07:51 PM
Help with SaveAs Glen Mettler[_2_] Excel Programming 1 January 29th 04 05:32 PM
SaveAs,csv popo pop Excel Programming 2 October 31st 03 06:08 AM


All times are GMT +1. The time now is 01:22 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"