Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
I have defined a subroutine in the ThisWorkbook class as: Private Sub Workbook_BeforeClose(Cancel As Boolean) --- code --- code End Sub Now I have another subroutine in Module 1 of my workbook: Sub Userform() -- Code -- Code If Err = 0 Then Call Workbook_BeforeClose(True) Exit Sub End If End Sub Now I want to call the subroutine Workbook_BeforeClose from within the Userform() routine, if there is an Error is encountered -- basically i want to close the entire workbook. Can somebody shed light on how to achieve this ? Thanks, Ravi |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Calling a VBA add in from a macro subroutine | Excel Programming | |||
HELP! Calling subroutine in different workbook | Excel Programming | |||
Calling a subroutine in a loop | Excel Programming | |||
calling a subroutine outside a spreadsheet | Excel Programming | |||
Function Calling Subroutine | Excel Programming |