Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an existing workbook (WrkBk1) that contains two sheets. I also
have an addin (addin) that inserts a new sheet into WrkBk1. When the user is done with the workbook I want it to delete the sheet that was added in, then save and then close both WrkBk1 and the addin. Here is the code that I am using to initiate the activity. Private Sub workbook_beforeclose(cancel As Boolean) Application.DisplayAlerts = False ActiveWorkbook.Sheets("What If").Delete Application.DisplayAlerts = True ActiveWorkbook.Save End Sub It works fine if it is saved into WrkBk1 but I can't do that I need everything to be contained in the addin. Right now it is saved into a module, I'm not sure if that makes a difference or not. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to close an Addin? | Excel Discussion (Misc queries) | |||
VBA Code to kick off macro when workbook command to close is initi | Excel Discussion (Misc queries) | |||
Deleting Command Bars on close of a workbook | Excel Programming | |||
Executinh Addin Sub Menu Command | Excel Programming | |||
Addin Close problem | Excel Programming |