Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a command button on Sheet1
the click event says application.run "personal.xls!OtherMacro" The called macro is in a code module named "MyModule" in personal.xls. It is declared as Sub OtherMacro() I am getting an application error every time the click event fires, any ideas? TIA ... Bill |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A sub to be Public to be used by any other module:
Public Sub OtherMacro() "William Benson" wrote: I have a command button on Sheet1 the click event says application.run "personal.xls!OtherMacro" The called macro is in a code module named "MyModule" in personal.xls. It is declared as Sub OtherMacro() I am getting an application error every time the click event fires, any ideas? TIA ... Bill |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This sub is in a module called CharStats, in Personal.xls:
Public Sub FindChar() frmFindCharacters.Show End Sub This is the click event of command button on a sheet in another open file: Private Sub CommandButton1_Click() Application.Run "Personal.xls!FindChar" End Sub This is the error message I am getting: The macro 'Personal.xls!FindChar' cannot be found. Any help? "K Dales" wrote in message ... A sub to be Public to be used by any other module: Public Sub OtherMacro() "William Benson" wrote: I have a command button on Sheet1 the click event says application.run "personal.xls!OtherMacro" The called macro is in a code module named "MyModule" in personal.xls. It is declared as Sub OtherMacro() I am getting an application error every time the click event fires, any ideas? TIA ... Bill |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this:
1. Insert a module in the workbook where your button is; (VBE, insert, module) 2. Copy the code from your Personal.xls to this module; 3. Go in the sheet where you have the button (right-click reassign macro, and point to the one in your workbook) 4. ... Good Luck Philippe Léveillé "William Benson" a écrit dans le message de news: ... I have a command button on Sheet1 the click event says application.run "personal.xls!OtherMacro" The called macro is in a code module named "MyModule" in personal.xls. It is declared as Sub OtherMacro() I am getting an application error every time the click event fires, any ideas? TIA ... Bill |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Reproduced the situation you describe and it worked fine for me.
xl2003, but I wouldn't expect it to be different in other versions. -- Regards, Tom Ogilvy "William Benson" wrote in message ... This sub is in a module called CharStats, in Personal.xls: Public Sub FindChar() frmFindCharacters.Show End Sub This is the click event of command button on a sheet in another open file: Private Sub CommandButton1_Click() Application.Run "Personal.xls!FindChar" End Sub This is the error message I am getting: The macro 'Personal.xls!FindChar' cannot be found. Any help? "K Dales" wrote in message ... A sub to be Public to be used by any other module: Public Sub OtherMacro() "William Benson" wrote: I have a command button on Sheet1 the click event says application.run "personal.xls!OtherMacro" The called macro is in a code module named "MyModule" in personal.xls. It is declared as Sub OtherMacro() I am getting an application error every time the click event fires, any ideas? TIA ... Bill |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I had it declared twice, in separate modules. Why the %$#$^$%$ can't Excel
just say so! Sorry Tom/Philippe "Philippe Léveillé" wrote in message ... Try this: 1. Insert a module in the workbook where your button is; (VBE, insert, module) 2. Copy the code from your Personal.xls to this module; 3. Go in the sheet where you have the button (right-click reassign macro, and point to the one in your workbook) 4. ... Good Luck Philippe Léveillé "William Benson" a écrit dans le message de news: ... I have a command button on Sheet1 the click event says application.run "personal.xls!OtherMacro" The called macro is in a code module named "MyModule" in personal.xls. It is declared as Sub OtherMacro() I am getting an application error every time the click event fires, any ideas? TIA ... Bill |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
'The process cannot access the file because it is in use by anothe | Excel Discussion (Misc queries) | |||
Call a batch file from an Excel Macro | Excel Discussion (Misc queries) | |||
Call a batch file from an Excel Macro | Excel Discussion (Misc queries) | |||
open file, then call macro... won't work | Excel Programming | |||
How to call File Open / Save Window in a Macro | Excel Programming |