LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Can I disable Save?

Hi Patrick,

You should consider keeping your code separate from your report. That way,
you don't have to worry about the user saving the report, and no code will
reside in the report itself.

Basically, you could create an Add-In that contains all the code. In this
Add-In, you would use code like this to open your report template:

Dim wb As Workbook

Set wb = Workbooks.Add(Template:="c:\my_report.xlt")

Now you have opened the workbook and the object variable wb contains a
reference to that workbook. When you're done, you just set wb = Nothing and
allow the user to do what he/she will with the report. Since you're using a
template, the user will be prompted to save the resulting workbook to a new
location when saving. To be safe, you'll want to keep a copy of your
template, and you may want to make the template read-only and/or set NTFS
permissions on it so it is read-only. That way, a user can't inadvertently
modify the template directly.

Regards,

Jake Marx
MS MVP - Excel


"Patrick" wrote in message
...
I apologize if this has already been addressed... I could
not find it with a search.

My code starts a 3270 emulator session, navigates to a
report on the host, rips the data out, and populates a
sheet in the workbook. The user will do this daily and
there are many rows of data.

I would like to prevent the user from saving the workbook
(leaving the workbook pristine and uncluttered by daily
junk), though they should be free to SaveAs.

Secondly,
When they use SaveAs, is there a way to prevent the VBA
code from being saved along with the data on the sheets?

Many Thanks!
patrick



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable Save/Save As - not working? Silena K-K Excel Discussion (Misc queries) 3 December 11th 07 03:09 PM
Disable save Firkins Excel Discussion (Misc queries) 5 December 10th 07 09:25 PM
Disable Quick Save & Save As L Weber Excel Discussion (Misc queries) 6 October 18th 07 08:57 PM
Disable save Jeff Excel Discussion (Misc queries) 2 October 3rd 07 02:31 PM
Disable save nobbyknownowt Setting up and Configuration of Excel 1 February 14th 07 08:18 PM


All times are GMT +1. The time now is 10:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"