Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a workbook with a workbook open code as follows :
Private Sub Workbook_Open() Worksheets("instructions").Activate Worksheets("instructions").Range("B14").Select Application.ScreenUpdating = True If Worksheets("instructions").Range("B14").Value = "" Then Selection = InputBox("Enter your employee Number!") Worksheets("instructions").Range("e14").Select MsgBox "Please note that your Functional Centre is : " & ThisWorkbook.Worksheets("EE Details Revised").Range("h1").Value ", _ vbOKOnly, "Important information." Else Worksheets("Form").Activate Worksheets("Form").Range("A8").Select End If End Sub Another code in THIS WORKBOOK pane is Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Application.EnableEvents = False SaveItAs Application.EnableEvents = True Cancel = True End Sub This calls for a SAVEITAS code which is in Module 1. The SAVEITAS code has a msgbox for saving with YES,NO,CANCEL. Yes-it saves the file, No closes without saving and cancel doesnt do anything. The problem: On clicking Yes or cancel, it works fine, but when NO is clicked, the file closes but when it is opened up next time, it should execute the workbook open code which it doesnt and therefore does not display the input box as required by Open code. However, if I exit out of Excel completely and come back to open the file, then workbook open code executes. Any idea why it happens this way. Is there a solution to this problem? Any help will be greatly appreciated. Regards SK *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
(trying again...) code stops executing | Excel Programming | |||
VBA code stops executing | Excel Programming | |||
Code Changes Not Executing | Excel Programming | |||
Excel VBA code executing a variable as a Sub. | Excel Programming | |||
executing code when a module opens | Excel Programming |