Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force saving as a given file type

Status
Not open for further replies.

krinid

Programmer
Jun 10, 2003
356
CA
Is there a smooth way to force users to save workbooks in a given Excel format? (In my case, whatever the most recent version available is, which I believe is the type "Excel Workbook")

I've done a whole whack of stuff in Workbook_BeforeSave but it's kind of awkward and there's a bunch of 'workarounds' and there just must be an easier way!

(Currently, I'm calling a second save event with file type Excel Workbook and then canceling the original save event--which requires recursion.)
 
There are a couple of ways :-
1. Disable save in the BeforeSave event by using :-
MsgBox ("Please use save button")
Cancel = True

Put a "Save" button somewhere and do the whole thing in code.

2. In BeforeSave Prompt the user for a filename and use SaveAs (see VB Editor help for parameters). Save the file. Use Cancel=True.







Regards
BrianB
** Let us know if you get something that works !
================================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top