Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default Application.Run "[TemplateName].[ModuleName].[MacroName]

Hello,
I am trying to call a sub in a module in an XLA from a regular excel
document.

I would like to pass along the
Public Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target
As Range, Cancel As Boolean)

Action to the xla

So if my XLA is called Foo
And the module is called bar
How can I do this
I have tried the following

In the worksheet:

Public Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target
As Range, Cancel As Boolean)
Application.Run "foo.bar.Workbook_SheetBeforeDoubleClick", Sh, Target,
Cancel
End Sub

which does not work

also tried just
Public Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target
As Range, Cancel As Boolean)
Application.Run "Workbook_SheetBeforeDoubleClick", Sh, Target, Cancel
End Sub



In my XLA the sub in the module is:
Public Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target
As Range, Cancel As Boolean)
<<my code
End Sub



however I never see the call coming into the XLA


Any ideas?

thanks




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Application.Run "[TemplateName].[ModuleName].[MacroName]

You just need the name of the workbook (with extension) and the macro:

Application.Run "Book1.xls!RunMe"

--
Jim
"greg" wrote in message
...
| Hello,
| I am trying to call a sub in a module in an XLA from a regular excel
| document.
|
| I would like to pass along the
| Public Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal
Target
| As Range, Cancel As Boolean)
|
| Action to the xla
|
| So if my XLA is called Foo
| And the module is called bar
| How can I do this
| I have tried the following
|
| In the worksheet:
|
| Public Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal
Target
| As Range, Cancel As Boolean)
| Application.Run "foo.bar.Workbook_SheetBeforeDoubleClick", Sh, Target,
| Cancel
| End Sub
|
| which does not work
|
| also tried just
| Public Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal
Target
| As Range, Cancel As Boolean)
| Application.Run "Workbook_SheetBeforeDoubleClick", Sh, Target, Cancel
| End Sub
|
|
|
| In my XLA the sub in the module is:
| Public Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal
Target
| As Range, Cancel As Boolean)
| <<my code
| End Sub
|
|
|
| however I never see the call coming into the XLA
|
|
| Any ideas?
|
| thanks
|
|
|
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default Application.Run "[TemplateName].[ModuleName].[MacroName]

So you mean
Application.Run "foo.xla.bar.Workbook_SheetBeforeDoubleClick", Sh, Target,


"Jim Rech" wrote in message
...
You just need the name of the workbook (with extension) and the macro:

Application.Run "Book1.xls!RunMe"

--
Jim
"greg" wrote in message
...
| Hello,
| I am trying to call a sub in a module in an XLA from a regular excel
| document.
|
| I would like to pass along the
| Public Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal
Target
| As Range, Cancel As Boolean)
|
| Action to the xla
|
| So if my XLA is called Foo
| And the module is called bar
| How can I do this
| I have tried the following
|
| In the worksheet:
|
| Public Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal
Target
| As Range, Cancel As Boolean)
| Application.Run "foo.bar.Workbook_SheetBeforeDoubleClick", Sh,
Target,
| Cancel
| End Sub
|
| which does not work
|
| also tried just
| Public Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal
Target
| As Range, Cancel As Boolean)
| Application.Run "Workbook_SheetBeforeDoubleClick", Sh, Target, Cancel
| End Sub
|
|
|
| In my XLA the sub in the module is:
| Public Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal
Target
| As Range, Cancel As Boolean)
| <<my code
| End Sub
|
|
|
| however I never see the call coming into the XLA
|
|
| Any ideas?
|
| thanks
|
|
|
|




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Application.Run "[TemplateName].[ModuleName].[MacroName]

This works for me:

Run "WorkbookWithExtension!ModuleName.SubName", Sh, Target, Cancel

--
Jim
"greg" wrote in message
...
| So you mean
| Application.Run "foo.xla.bar.Workbook_SheetBeforeDoubleClick", Sh, Target,
|
|
| "Jim Rech" wrote in message
| ...
| You just need the name of the workbook (with extension) and the macro:
|
| Application.Run "Book1.xls!RunMe"
|
| --
| Jim
| "greg" wrote in message
| ...
| | Hello,
| | I am trying to call a sub in a module in an XLA from a regular excel
| | document.
| |
| | I would like to pass along the
| | Public Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal
| Target
| | As Range, Cancel As Boolean)
| |
| | Action to the xla
| |
| | So if my XLA is called Foo
| | And the module is called bar
| | How can I do this
| | I have tried the following
| |
| | In the worksheet:
| |
| | Public Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal
| Target
| | As Range, Cancel As Boolean)
| | Application.Run "foo.bar.Workbook_SheetBeforeDoubleClick", Sh,
| Target,
| | Cancel
| | End Sub
| |
| | which does not work
| |
| | also tried just
| | Public Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal
| Target
| | As Range, Cancel As Boolean)
| | Application.Run "Workbook_SheetBeforeDoubleClick", Sh, Target,
Cancel
| | End Sub
| |
| |
| |
| | In my XLA the sub in the module is:
| | Public Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal
| Target
| | As Range, Cancel As Boolean)
| | <<my code
| | End Sub
| |
| |
| |
| | however I never see the call coming into the XLA
| |
| |
| | Any ideas?
| |
| | thanks
| |
| |
| |
| |
|
|
|
|


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
filename!macroname as variables no1jimmyman Excel Discussion (Misc queries) 0 February 14th 11 09:04 PM
Filename leads MacroName CLR Excel Programming 4 January 29th 07 05:26 PM
Application.Run (WorkBook.Name & "!MacroName") Marve Excel Programming 2 October 23rd 06 03:21 PM
"WinForm Application" to act as "RTD Server" using .Net mduraidi Excel Programming 0 March 30th 06 12:55 PM
Application.Run("MacroName", Args) Abraham Andres Luna Excel Programming 2 January 23rd 06 07:05 PM


All times are GMT +1. The time now is 04:52 AM.

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"