Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Call subroutine problem

I have a workbook that has about 50 sheets and makes extensive use of vba.
However, I now have created an IribbonUI interface and am getting a Catch-22
in the various calls.
In ThisWorkbook class module I have set the iribbonui to a property. The
ribbon_onLoad is in another module and loads fine. However, if I try to call
another subroutine (Workflow, which is the routine that activates sheets an
invalidates ribbon controls) the controls will not invalidate until
the -onLoad routine exits.
Here is where I am stuck. Is there some way that I can get another event to
fire which I can then use to call the workflow module?

Summary:
Used to be: Workbook_Open called -- Workflow (Error 91 Object variable not
set - because Ribbon_onLoad would not run until Workbook exited).
Is now: workbook_Open exit sub - RibbonUI-onLoad fires but I can't call
Workflow from it.

Need a workaround to be able to trigger another event or do a goto outside
of the Subroutine.

Thanks for your assistance.

.... rick

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Call subroutine problem

You need to reorganize your code. A module can call a class module but a
class module cannot call a moulde. You need to exit the class module.

Probably your solution is to split your class module up into a differnt
number of functions. Then from the module routine

1) Call Class function 1 ( Init function)
2) Call Class function 2

"rick" wrote:

I have a workbook that has about 50 sheets and makes extensive use of vba.
However, I now have created an IribbonUI interface and am getting a Catch-22
in the various calls.
In ThisWorkbook class module I have set the iribbonui to a property. The
ribbon_onLoad is in another module and loads fine. However, if I try to call
another subroutine (Workflow, which is the routine that activates sheets an
invalidates ribbon controls) the controls will not invalidate until
the -onLoad routine exits.
Here is where I am stuck. Is there some way that I can get another event to
fire which I can then use to call the workflow module?

Summary:
Used to be: Workbook_Open called -- Workflow (Error 91 Object variable not
set - because Ribbon_onLoad would not run until Workbook exited).
Is now: workbook_Open exit sub - RibbonUI-onLoad fires but I can't call
Workflow from it.

Need a workaround to be able to trigger another event or do a goto outside
of the Subroutine.

Thanks for your assistance.

.... rick

.

Reply
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
Call Subroutine in Excel DogLover Excel Programming 3 November 5th 09 10:31 AM
Call a subroutine using variable subroutine name dhstein Excel Discussion (Misc queries) 3 July 26th 09 08:28 PM
Can't call a subroutine donwb Excel Programming 3 August 6th 08 05:05 AM
Call subroutine from another workbook DejaVu[_55_] Excel Programming 2 November 3rd 05 04:12 PM
Call Subx for excel 97 Add-In subroutine Dave D-C[_3_] Excel Programming 4 March 2nd 05 08:05 PM


All times are GMT +1. The time now is 06:57 AM.

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"