LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro calling another Macro

I copied your code from your posting and renamed the module in personal.xls
to CharStats. Created a Userform in Personal.xls named frmFindCharacters.
Added a commandbutton1 in another workbook and pasted your event code there.
It worked fine for me.

--
Regards,
Tom Ogilvy

"William Benson" wrote in message
...
I did not get an answer that worked for me in an earlier post, am trying
again - if someone can figure out what is wrong I would really appreciate
it:

I have a subprocedure shown below, in a module which is named CharStats,

in
Personal.xls:

Public Sub FindChar()
frmFindCharacters.Show
End Sub

I want the click event of command button on a sheet in another open

workbook
to call it, and wrote:

Private Sub CommandButton1_Click()
Application.Run "Personal.xls!FindChar"
End Sub

I am getting an error message saying : "The macro 'Personal.xls!FindChar'
cannot be found.

Pls help, thanks.

"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








 
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
macro calling another macro + variables yo Excel Discussion (Misc queries) 2 April 5th 06 04:36 PM
Calling a macro from a key RWN Excel Programming 0 February 8th 05 05:19 AM
macro calling macro Paul Excel Programming 1 January 14th 05 06:43 PM
how to disable a macro by calling it from another macro paritoshmehta[_9_] Excel Programming 1 May 6th 04 07:24 PM
Calling macro in add-in. Clark B Excel Programming 1 July 24th 03 11:05 PM


All times are GMT +1. The time now is 03:36 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"