Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Call vs. Run command

I am a little cofused between the Call and Run commands.
I have a hidden worksheet (testfile.xls) that loads every
time excel is open (Note: Thisworksheet.isaddin = True &
Macro Security Level is set to Medium).

From a new workbook I want to create a button that calls
a subroutine, MySub(), from testfile.xls. I tried to use:
Call MySub()
but it was not recognized. After a little research, I
used:
Run "MySub()"
and it seems to work. My question is what is the
difference between the Run and Call Commands? I thought
they were essentially the same functions.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Call vs. Run command

Call only works with procedures within the scope of the current project.
This includes the module with the code, public modules in the workbook and
similar modules in any workbook which this workbook has a reference set to
(in tools = reference in the VBE).

Run will execute a macro in another workbook if it can be found.

--
Regards,
Tom Ogilvy


"Chris McFarland" wrote in message
...
I am a little cofused between the Call and Run commands.
I have a hidden worksheet (testfile.xls) that loads every
time excel is open (Note: Thisworksheet.isaddin = True &
Macro Security Level is set to Medium).

From a new workbook I want to create a button that calls
a subroutine, MySub(), from testfile.xls. I tried to use:
Call MySub()
but it was not recognized. After a little research, I
used:
Run "MySub()"
and it seems to work. My question is what is the
difference between the Run and Call Commands? I thought
they were essentially the same functions.



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
One command in one cell initiating another command in another cel. Chas52 Excel Worksheet Functions 3 November 7th 09 06:57 PM
command code ( GOTO command) in formula calan New Users to Excel 1 June 11th 09 09:44 AM
Pivot Table Error Message - "Command Text not set for command obje Jeff Divian Excel Discussion (Misc queries) 0 November 7th 07 10:26 PM
Call Center Management: How to calculate 'cost per call' Denniso6 Excel Discussion (Misc queries) 2 June 25th 06 05:01 PM
call excel 2003 macro from command line Keven[_2_] Excel Programming 1 June 2nd 04 05:33 AM


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