View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default How to "unnamed" workbook.

Look in Excel help at the beforeSave event.

http://www.cpearson.com/excel/events.htm

you would cancel the save by setting

Cancel = True
then disable events
Application.EnableEvents = False
then put up the saveas dialog

fname = Application.GetSaveAsFileName

then save the file if the name is acceptable

thisworkbook.SaveAs fname

reenable events
Application.EnableEvents = True

--
Regards,
Tom Ogilvy



"witek" wrote:


I have an opened workbook which was saved by a user.
Now I need to treat this workbook as a new, so after clicking File/Save
(not Save as) Excel will open dialog window to provide filename.

Is there any way to do this from VBA?