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: 3
Default Deleting Code and saving

I have an Excel 2000 template comprising 2 worksheets - 1 for data entry and
1 for "Reporting". I have VBA code associated with the data entry sheet for
two command buttons - first button saves workbook "as is" with dynamic name
based on entered data - this allows additional data entry at a later time.
Second button is used when data entry is complete - it copies and paste
special values on the report sheet, deletes the data entry sheet (which
includes the VBA code) and saves the workbook with a new file name and gives
the option to close the workbook. The workbook IS saved using the VBA (I can
check it with explorer) but UNLESS I click on the toolbar "Save", or use
"File/Save as" or save changes when actually closing I have a problem - when
I next open the save file - first I am asked if I want to enable or disable
macros (there aren't any because they were deleted with the data entry sheet)
then, regardless of enabled or disabled macros The workbook opens and
immediately crashes. If I do click on the toolbar "Save", or use "File/Save
as" or save changes before actually closing then everything is fine - buit it
is noticable that the file size drops by 10KB (template is 70KB, the file as
saved after using the second command button is 50KB but on using any of the
UI save functions it drops to 40KB) - so something is being removed here -
but why doesn't the VBA Save/Save As.. also remove the same stuff? Since I'm
deleting the VBA it is difficult to "make" users save before closing -
particular since the program output is suggesting the saving has been done!
When I started down this route I never expected it to work (how can you
expect a program to delete itself then terminate gracefully?) - but it is so
close that it is now annoying - any ideas on saving and closing in VBA would
be appreciated!
 
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
Saving Auto-Filtered Data (or deleting the rest) CH53 Excel Discussion (Misc queries) 3 December 11th 07 01:07 AM
Saving without deleting previous input kdmarvin Excel Worksheet Functions 10 March 14th 07 09:51 PM
I need help deleting macros and VB controls and saving as new workbook [email protected] Excel Programming 4 October 5th 06 08:31 PM
Deleting data in cells while saving formatting & formulas greymann19 New Users to Excel 1 October 10th 05 10:56 PM
Deleting macro after saving Hans_[_5_] Excel Programming 1 July 27th 05 08:14 PM


All times are GMT +1. The time now is 11:49 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"