ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calls from sheet module to ThisWorkbook module (https://www.excelbanter.com/excel-programming/332627-calls-sheet-module-thisworkbook-module.html)

quartz[_2_]

Calls from sheet module to ThisWorkbook module
 
I am using Office 2003 on Windows XP.

I have a "BeforeDoubleClick" event procedure in a Sheet module that needs to
call a "Workbook_Open" event procedure in the "ThisWorkBook" module. I tried
the following, but of course this produces an error:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Call Workbook_Open
End Sub

Can someone please correct my code above or otherwise describe how I can
accomplish this?

Thanks in advance.

Bob Phillips[_7_]

Calls from sheet module to ThisWorkbook module
 
Call ThisWorkbook.Workbook_Open

and change the declaration of Workbook_Open to Public.


--
HTH

Bob Phillips

"quartz" wrote in message
...
I am using Office 2003 on Windows XP.

I have a "BeforeDoubleClick" event procedure in a Sheet module that needs

to
call a "Workbook_Open" event procedure in the "ThisWorkBook" module. I

tried
the following, but of course this produces an error:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Call Workbook_Open
End Sub

Can someone please correct my code above or otherwise describe how I can
accomplish this?

Thanks in advance.




Malcolm Makin[_2_]

Calls from sheet module to ThisWorkbook module
 
First, make the Workbook_Open even procedure public by going to where it is
defined, and changing the "Private Sub" to "Public Sub". Then in your code
for Worksheet_BeforeDoubleClick, change it to say this:

Call ThisWorkbook.Workbook_Open


Regards,

Malcolm


"quartz" wrote:

I am using Office 2003 on Windows XP.

I have a "BeforeDoubleClick" event procedure in a Sheet module that needs to
call a "Workbook_Open" event procedure in the "ThisWorkBook" module. I tried
the following, but of course this produces an error:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Call Workbook_Open
End Sub

Can someone please correct my code above or otherwise describe how I can
accomplish this?

Thanks in advance.



All times are GMT +1. The time now is 07:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com