Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Send menu call to explicit Sub

Am trying to direct a menu call to a specific Project and
Sub. The following attempt is not working:

With .Controls.Add(Type:=msoControlButton)
.Caption = "&Add a Standard Page"
.OnAction = "AddBofQStandardPage"
End With

More correctly, it is working, but is calling the sub
"AddBofQStandardPage" from a module in a different
Project.

How do I reference the sub in, say
Project1, Module1, when the the menu item is
triggered, please?

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Send menu call to explicit Sub

.OnAction = "MyWorkbookName.xls!AddBofQStandardPage"

Assume you don't have two procedures with that name in that workbook. If
the workbook isn't open, include the path.

--
Regards,
Tom Ogilvy


Stuart wrote in message
...
Am trying to direct a menu call to a specific Project and
Sub. The following attempt is not working:

With .Controls.Add(Type:=msoControlButton)
.Caption = "&Add a Standard Page"
.OnAction = "AddBofQStandardPage"
End With

More correctly, it is working, but is calling the sub
"AddBofQStandardPage" from a module in a different
Project.

How do I reference the sub in, say
Project1, Module1, when the the menu item is
triggered, please?

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Send menu call to explicit Sub

Just to be sure, can one reference the module in that statement,
ie
..OnAction = "MyWorkbookName.xls! _Module1_AddBofQStandardPage"

Regards.

"Tom Ogilvy" wrote in message
...
.OnAction = "MyWorkbookName.xls!AddBofQStandardPage"

Assume you don't have two procedures with that name in that workbook. If
the workbook isn't open, include the path.

--
Regards,
Tom Ogilvy


Stuart wrote in message
...
Am trying to direct a menu call to a specific Project and
Sub. The following attempt is not working:

With .Controls.Add(Type:=msoControlButton)
.Caption = "&Add a Standard Page"
.OnAction = "AddBofQStandardPage"
End With

More correctly, it is working, but is calling the sub
"AddBofQStandardPage" from a module in a different
Project.

How do I reference the sub in, say
Project1, Module1, when the the menu item is
triggered, please?

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 23/09/2003


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Send menu call to explicit Sub

..OnAction = "MyWorkbookName.xls!Module1.AddBofQStandardPag e"

--
Regards,
Tom Ogilvy

Stuart wrote in message
...
Just to be sure, can one reference the module in that statement,
ie
.OnAction = "MyWorkbookName.xls! _Module1_AddBofQStandardPage"

Regards.

"Tom Ogilvy" wrote in message
...
.OnAction = "MyWorkbookName.xls!AddBofQStandardPage"

Assume you don't have two procedures with that name in that workbook.

If
the workbook isn't open, include the path.

--
Regards,
Tom Ogilvy


Stuart wrote in message
...
Am trying to direct a menu call to a specific Project and
Sub. The following attempt is not working:

With .Controls.Add(Type:=msoControlButton)
.Caption = "&Add a Standard Page"
.OnAction = "AddBofQStandardPage"
End With

More correctly, it is working, but is calling the sub
"AddBofQStandardPage" from a module in a different
Project.

How do I reference the sub in, say
Project1, Module1, when the the menu item is
triggered, please?

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 23/09/2003




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Send menu call to explicit Sub

Most odd.

..OnAction = "BofQ Utilities.xla!Menu_Routines.AddBofQStandardPage"
results in a the same named sub being called from a completely different
project and module....

How can this be, please?

Regards.

"Tom Ogilvy" wrote in message
...
.OnAction = "MyWorkbookName.xls!Module1.AddBofQStandardPag e"

--
Regards,
Tom Ogilvy

Stuart wrote in message
...
Just to be sure, can one reference the module in that statement,
ie
.OnAction = "MyWorkbookName.xls! _Module1_AddBofQStandardPage"

Regards.

"Tom Ogilvy" wrote in message
...
.OnAction = "MyWorkbookName.xls!AddBofQStandardPage"

Assume you don't have two procedures with that name in that workbook.

If
the workbook isn't open, include the path.

--
Regards,
Tom Ogilvy


Stuart wrote in message
...
Am trying to direct a menu call to a specific Project and
Sub. The following attempt is not working:

With .Controls.Add(Type:=msoControlButton)
.Caption = "&Add a Standard Page"
.OnAction = "AddBofQStandardPage"
End With

More correctly, it is working, but is calling the sub
"AddBofQStandardPage" from a module in a different
Project.

How do I reference the sub in, say
Project1, Module1, when the the menu item is
triggered, please?

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 23/09/2003






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 23/09/2003




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Send menu call to explicit Sub

No offense intended, but naturally I remain incredulous.

How can this be, please?

Some mistake or assumption on your part I would assume.

In the macro that is running (not the one you cite), put in a line of code
like

msgbox commandbars.ActionControl.OnAction

If it shows

BofQ Utilities.xla!Menu_Routines.AddBofQStandardPage

and that isn't the macro that is running, then I'm the fool.

--
Regards,
Tom Ogilvy

Stuart wrote in message
...
Most odd.

.OnAction = "BofQ Utilities.xla!Menu_Routines.AddBofQStandardPage"
results in a the same named sub being called from a completely different
project and module....

How can this be, please?

Regards.

"Tom Ogilvy" wrote in message
...
.OnAction = "MyWorkbookName.xls!Module1.AddBofQStandardPag e"

--
Regards,
Tom Ogilvy

Stuart wrote in message
...
Just to be sure, can one reference the module in that statement,
ie
.OnAction = "MyWorkbookName.xls! _Module1_AddBofQStandardPage"

Regards.

"Tom Ogilvy" wrote in message
...
.OnAction = "MyWorkbookName.xls!AddBofQStandardPage"

Assume you don't have two procedures with that name in that

workbook.
If
the workbook isn't open, include the path.

--
Regards,
Tom Ogilvy


Stuart wrote in message
...
Am trying to direct a menu call to a specific Project and
Sub. The following attempt is not working:

With .Controls.Add(Type:=msoControlButton)
.Caption = "&Add a Standard Page"
.OnAction = "AddBofQStandardPage"
End With

More correctly, it is working, but is calling the sub
"AddBofQStandardPage" from a module in a different
Project.

How do I reference the sub in, say
Project1, Module1, when the the menu item is
triggered, please?

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 23/09/2003






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 23/09/2003




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Send menu call to explicit Sub

Thanks for the help. Here's what I've done:

In the subs named "AddBofQStandardPage" across 3 projects
there is a line:
If Not (.Column = 1 And (.Offset(-1, £Col - 1).Value = "£") And _
.Row 1 And .Value = "Item") Then
MsgBox "You cannot insert or add a page he _
" & ActiveCell.Address
Exit Sub
End If

I placed a breakpoint on "Exit Sub" in each of the routines. Then
choosing a suitable non-acceptable cell, I ran the menu code.
It stopped in "AddBofQStandardPage" in module "MenuRoutines"
in project "MasterPQSBofQCode1.xla".

The menu call operating is:
With .Controls.Add(Type:=msoControlButton)
.Caption = "&Add a Standard Page"
.OnAction = "BofQ Utilities.xla!Menu_Routines.AddBofQStandardPage"
End With
and it is being called from "BofQ Utilities.xla".

I spent several hours before my original post trying to work out
what was going on (including using
BofQ Utilities.xla!.AddBofQStandardPage) without success.
(Didn't know how to include a reference to the module)

I set a new breakpoint, then added
"msgbox commandbars.ActionControl.OnAction"
into each of the named subs, just before "Exit Sub". It returned
"AddBofQStandardPage" from project/module
"MasterPQSBofQCode1.xla!MenuRoutines".

Regards and thanks (foolishly).



"Tom Ogilvy" wrote in message
...
No offense intended, but naturally I remain incredulous.

How can this be, please?

Some mistake or assumption on your part I would assume.

In the macro that is running (not the one you cite), put in a line of code
like

msgbox commandbars.ActionControl.OnAction

If it shows

BofQ Utilities.xla!Menu_Routines.AddBofQStandardPage

and that isn't the macro that is running, then I'm the fool.

--
Regards,
Tom Ogilvy

Stuart wrote in message
...
Most odd.

.OnAction = "BofQ Utilities.xla!Menu_Routines.AddBofQStandardPage"
results in a the same named sub being called from a completely different
project and module....

How can this be, please?

Regards.

"Tom Ogilvy" wrote in message
...
.OnAction = "MyWorkbookName.xls!Module1.AddBofQStandardPag e"

--
Regards,
Tom Ogilvy

Stuart wrote in message
...
Just to be sure, can one reference the module in that statement,
ie
.OnAction = "MyWorkbookName.xls! _Module1_AddBofQStandardPage"

Regards.

"Tom Ogilvy" wrote in message
...
.OnAction = "MyWorkbookName.xls!AddBofQStandardPage"

Assume you don't have two procedures with that name in that

workbook.
If
the workbook isn't open, include the path.

--
Regards,
Tom Ogilvy


Stuart wrote in message
...
Am trying to direct a menu call to a specific Project and
Sub. The following attempt is not working:

With .Controls.Add(Type:=msoControlButton)
.Caption = "&Add a Standard Page"
.OnAction = "AddBofQStandardPage"
End With

More correctly, it is working, but is calling the sub
"AddBofQStandardPage" from a module in a different
Project.

How do I reference the sub in, say
Project1, Module1, when the the menu item is
triggered, please?

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.520 / Virus Database: 318 - Release Date:

18/09/2003






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 23/09/2003






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 23/09/2003






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 24/09/2003


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
how to get send option under file menu in excel sheet Send to Excel Discussion (Misc queries) 0 April 29th 08 07:20 PM
No Send to in File menu Ray[_5_] New Users to Excel 2 November 29th 07 02:56 AM
option explicit Dave F Excel Discussion (Misc queries) 2 September 5th 06 02:46 PM
How do I change the order of choices in menu File- Send To SCPC7018 Excel Worksheet Functions 2 August 4th 05 02:11 AM
SEND TO menu RedSoft Excel Discussion (Misc queries) 1 February 16th 05 09:29 AM


All times are GMT +1. The time now is 02:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"