ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Make an unsaved file copy in memory? (https://www.excelbanter.com/excel-programming/295926-make-unsaved-file-copy-memory.html)

idealist

Make an unsaved file copy in memory?
 
Hello all. I am using VBA in Excel XP and Win 2k. Please help me if you can. Sorry for the length
I have a program structured as follows:

1. User opens a program file

2. An "on open" event then opens a template form file located elsewhere on the network (in a more secure location); The key is to keep the original template form unchanged by the user.

3. User can complete this form and click a "submit" button which: causes a program to increment a form counter and place a unique serial number on the form, saves the form in a specific location, and notifies the approver that a form is ready for review and approval

4. OR, the user can at any time, close the form without saving it (i.e. cancel). Since the "submit" button was not clicked, the form never receives a serial number (i.e. no skipped numbers) and is not saved

HERE IS THE QUESTION
I can do all of this already, except the part where a copy of the template form is opened for the user into memory. This would be as though a new unsaved Excel file were just opened, but not yet saved. Make sense? Is this even possible

The template contains a single visible sheet and two "very hidden" sheets, programs, and spreadsheet controls and would not receive a form number until the user saves it by clicking the "submit" button

Please help with this if you can or post back questions if my description is unclear. Thank you very much in advance for your assistance.

AA2e72E[_2_]

Make an unsaved file copy in memory?
 
I am not convinced I understand the problem. BUT ..
If you want Excel to behave as if the activeworkbook had not been saved, se

ActiveWorkBook.Saved = Fals

Or if you want Excel to behave as if the workbook had been saved, se

ActiveWorkBook.Saved = True

idealist

Make an unsaved file copy in memory?
 
Hi AA2e72E

Thanks for reply, but if I use "ActiveWorkBook.Saved = False" and the user clicks the "Submit" button, the program will save the currently active template file

Will this not cause my template file to be overwritten with a now completed form

I want the user to have access to a COPY of the original form (that is not yet saved)...can do?

Chris

Make an unsaved file copy in memory?
 
I'm confused, by default isn't a template just that: copies of the original. The template should not change!

Rollin_Again[_11_]

Make an unsaved file copy in memory?
 
Is this a true template form with an *.xlt* extension? If I am no
mistaken, once the template is filled out and saved, it is saved wit
an* .xls* extension. This will keep the original *.xlt* form intact.



Rolli

--
Message posted from http://www.ExcelForum.com


idealist

Make an unsaved file copy in memory?
 
Aha! Good point. Thanks to all who responded

My "template" is currently saved as an xls, I need to convert to an xlt.

Somehow, this concept totally slipped my mind

Thanks again.


All times are GMT +1. The time now is 10:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com