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!

Disabling Save In Excel

Status
Not open for further replies.

Hackster

Programmer
Mar 28, 2001
173
US
I have an VB6 application that dumps the results of an SQL query against a backend Oracle database to an Excel spreadsheet. The whole thing works like a champ, however, my question is this: The spreadsheet is a "template". I do not want them to be able to save the spreadsheet, although they may do a "Save As" and rename it. How do I disable the Save feature of a spreadsheet, and how do I prevent the "Do you want to save the changes to you made to SpreadsheetName.xls?" message box from appearing when the spreadsheet is closed?
 
I'm familiar with these statements, but where would one place this code? The spreadsheet is open, and sitting on the screen for the viewing pleasure of the user. Having the spreadsheet displayed is part of the specs. While it is sitting there being a spreadsheet, the entire Excel menu structure is available, as well as the closing "Do you want to save yada yada" message box. All the user has to do (I just did it) is hit the X in the upper right hand corner of the spreadsheet, or do File/Exit from the Excel menu.
 
Ok, since you give up control then you will have to do your own "SaveAs" and pass along the copy. Otherwise use
Code:
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
before turning it over but this disallows ANY changes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top