LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 234
Default Avoid saving file with code in

Hi, using Excel 2000.

I want to ensure that a file with the code isn't saved in error or during
testing. The code below saves the active workbook which works the majority
of times but has on occasion, saved the file with the code. I have set up a
line of code to capture the active file name when the code is run but can't
get the code that saves the file to display a message if the file bring
saved is the one with the code and then closes the file without saving.

Thanks in advance of any help. Rob

' this line sets iFname to the active file name
iFname = Application.ActiveWorkbook.Name

'save the active file
Set Wb = ActiveWorkbook
Application.DisplayAlerts = False
Wb.Save
Application.DisplayAlerts = True


 
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
VB Code for saving PDF Print File dallin Excel Programming 1 June 15th 07 10:20 PM
Continue executing code while saving file Henrich Excel Programming 1 March 29th 06 12:33 PM
How to avoid saving over an excisting Workbook.?.? ryanmhess Excel Programming 5 September 8th 05 05:57 AM
Code for saving as a .prn file Jim Rech Excel Programming 0 August 5th 03 01:38 PM


All times are GMT +1. The time now is 07:30 AM.

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

About Us

"It's about Microsoft Excel"