View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
bac bac is offline
external usenet poster
 
Posts: 76
Default Trap New File name before saving

I have a "template" workbook in which a user enters a Sales Order Number and
an SQL is executed to pull relevant data from our datawarehouse into three
worksheets in the workbook.

If the user decides to save the file under a different name, I would like to
remove some code and one of the worksheets. I know I can use the
Workbook_BeforeSave event to execute this code, but I only want it to run it
if the user saves the workbook under a different name.

How can I trap the name the file will be saved to so I can compare that to
the file's current name to determine whether or not to run the desired
BeforeSave code?

TIA
BAC