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: 68
Default Disassociate Macros when saving under different name

I have a macro which removes some sheets from a workbook, removes shapes
which run macros and saves the file under a new file name.

The macro runs and appears to do what it should but when I try to open the
newly saved file I see the front sheet but get an error message saying
Excel.exe has generated errors and will be closed by Windows.

I wondered if the solution would be to remove all the macros in This
Workbook (that's the only location) before the file save as process in case
the Auto_Open is causing a glitch. If so, how do I do this?

I'm running Office 2000 on Windows 2000.

I've put the code below to help make it clearer.

I'd appreciate any help with this as I've been stuck for hours. Thanks a
lot in anticipation.

Keith
----------
ActiveWindow.DisplayWorkbookTabs = True
Application.DisplayAlerts = False
Sheets("Menu").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Workings").Select
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
Sheets("Month by Month Analysis").Select
ActiveSheet.Shapes("AutoShape 1").Select
Selection.Cut
Sheets("Branch Analysis").Select
ActiveSheet.Shapes("AutoShape 1").Select
Selection.Cut
Sheets("Signup Report").Select
ActiveSheet.Shapes("AutoShape 1").Select
Selection.Cut
Sheets("Banked Report").Select
ActiveSheet.Shapes("AutoShape 1").Select
Selection.Cut
Sheets("Incentives").Select
ActiveSheet.Shapes("AutoShape 1").Select
Selection.Cut
Sheets("Data").Select
ActiveSheet.Shapes("AutoShape 12").Select
Selection.Cut
Sheets("Month by Month Analysis").Select
Range("A1").Select

ThisWorkbook.SaveAs "c:\#Reports\Reports\Reports " & Format(Date,
"dd-mm-yyyy")
End Sub

 
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 Macros MAtt Excel Discussion (Misc queries) 2 June 4th 08 06:07 PM
Disassociate existing macro from control key and execute by botton Trebor Retrac Excel Discussion (Misc queries) 2 September 3rd 05 02:40 AM
Saving Macros Gerald Excel Discussion (Misc queries) 1 August 19th 05 02:28 PM
weird saving of a document with macros resulting with macros being transfered to the copy alfonso gonzales Excel Programming 0 December 12th 04 09:19 PM
Saving Macros brodine Excel Worksheet Functions 1 November 9th 04 04:14 PM


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

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"