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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent Excel 97 save as newer version 1

Status
Not open for further replies.

Pcfred

Technical User
Joined
Jan 15, 2002
Messages
54
Location
US
I have a spreadsheet with a lot of VB in it and I need to limit any user from saving it as a new version of Excel(2000 or higher). Does anyone know how to limit this to just the Excel 97 version through code or another means?

Thnx in advance,
PCFred
 
Intercept the save, save as you desire, set Cancel to True.
 
I think you are out of luck, in reality. Please explain the exact situation, and why this is a problem.


You can put code in Workbook_BeforeSave, checking Application.Version. You can prevent the save or allow the save. But saving to a specific Excel 97 version? Not exactly sure about that. XlFileFormat has a slew of various formats, but I am not exactly sure that FileFormat:=xlExcel9795 will solve your problem.

I know that compiling in 2002 will have problems when the code runs in 97, but the code remains the same.
 
I find that even though Microsoft states they're compatible, some code doesn't run the same.

Also,
When a user saves the workbook in 2000 the chart data from my pivot table doesn't display correctly so I want to make sure it stays at 97.
 
In the workbook_BeforeSave
just put cancel = true
Then, write your own sub (you can record it) for saving and attach it to a button that says "SAVE" or similar

Within that code, at the start, put:
application.enableevents = false
This will stop the BeforeSave event from firing
and at the end
application.enableevents = true



Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
good idea xlbo...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top