Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Running Macros

I am relatively new to VBA in Excel and am having trouble.
I am trying to call a macro in another workbook and pass a
parameter to that macro. Help does not provide a
reasonable explanation or Example to follow. I would
appreciate any help I can get in solving this problem!

TIA

Steve
  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Running Macros

hi,
is the other workbook open. if not then the macro will be
unavailable.
if is is open then try activing the workbook before you
pass the parameter to it.

workbooks(workbookname.xls).activate

-----Original Message-----
I am relatively new to VBA in Excel and am having

trouble.
I am trying to call a macro in another workbook and pass

a
parameter to that macro. Help does not provide a
reasonable explanation or Example to follow. I would
appreciate any help I can get in solving this problem!

TIA

Steve
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Running Macros

I tried this and am still having trouble. I have been
opening the file with the following:

Workbooks.Open fileName:="c:\dirName\filename"

This works to open the file. When I try the
application.run command, I get a run time error (1004):
Method 'Run' of object '_Application' failed

Thankyou in advance fore your help!

Steve
-----Original Message-----
hi,
is the other workbook open. if not then the macro will be
unavailable.
if is is open then try activing the workbook before you
pass the parameter to it.

workbooks(workbookname.xls).activate

-----Original Message-----
I am relatively new to VBA in Excel and am having

trouble.
I am trying to call a macro in another workbook and pass

a
parameter to that macro. Help does not provide a
reasonable explanation or Example to follow. I would
appreciate any help I can get in solving this problem!

TIA

Steve
.

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Running Macros

When I do open the file first using the workbooks.open
command I get a run-time error 9, Subscript out of Range
error when the workbooks(filename).activate command is
issued.

I know this probably is not as hard as it appears, but
none of the resources I have available provide a clear
example of what I need to do. I know my problem has to be
syntax, but MS Excel help and one other resource I have at
hand do not provide any real help!

Frustrated! Help!

Thanks!

Steve


-----Original Message-----
hi,
is the other workbook open. if not then the macro will be
unavailable.
if is is open then try activing the workbook before you
pass the parameter to it.

workbooks(workbookname.xls).activate

-----Original Message-----
I am relatively new to VBA in Excel and am having

trouble.
I am trying to call a macro in another workbook and pass

a
parameter to that macro. Help does not provide a
reasonable explanation or Example to follow. I would
appreciate any help I can get in solving this problem!

TIA

Steve
.

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Running Macros

How about:

dim wkbk as workbook
set wkbk = workbooks.open(filename:="c:\...\macro.xls")
Application.Run "'" & wkbk.Name & "'!module1.macro1"



Steve wrote:

When I do open the file first using the workbooks.open
command I get a run-time error 9, Subscript out of Range
error when the workbooks(filename).activate command is
issued.

I know this probably is not as hard as it appears, but
none of the resources I have available provide a clear
example of what I need to do. I know my problem has to be
syntax, but MS Excel help and one other resource I have at
hand do not provide any real help!

Frustrated! Help!

Thanks!

Steve

-----Original Message-----
hi,
is the other workbook open. if not then the macro will be
unavailable.
if is is open then try activing the workbook before you
pass the parameter to it.

workbooks(workbookname.xls).activate

-----Original Message-----
I am relatively new to VBA in Excel and am having

trouble.
I am trying to call a macro in another workbook and pass

a
parameter to that macro. Help does not provide a
reasonable explanation or Example to follow. I would
appreciate any help I can get in solving this problem!

TIA

Steve
.

.


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Running Macros

Thankyou! That helps a lot!!!
-----Original Message-----
How about:

dim wkbk as workbook
set wkbk = workbooks.open(filename:="c:\...\macro.xls")
Application.Run "'" & wkbk.Name & "'!module1.macro1"



Steve wrote:

When I do open the file first using the workbooks.open
command I get a run-time error 9, Subscript out of Range
error when the workbooks(filename).activate command is
issued.

I know this probably is not as hard as it appears, but
none of the resources I have available provide a clear
example of what I need to do. I know my problem has to

be
syntax, but MS Excel help and one other resource I have

at
hand do not provide any real help!

Frustrated! Help!

Thanks!

Steve

-----Original Message-----
hi,
is the other workbook open. if not then the macro will

be
unavailable.
if is is open then try activing the workbook before

you
pass the parameter to it.

workbooks(workbookname.xls).activate

-----Original Message-----
I am relatively new to VBA in Excel and am having
trouble.
I am trying to call a macro in another workbook and

pass
a
parameter to that macro. Help does not provide a
reasonable explanation or Example to follow. I would
appreciate any help I can get in solving this problem!

TIA

Steve
.

.


--

Dave Peterson

.

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
running macros Jay Excel Discussion (Misc queries) 2 April 29th 05 12:56 AM
HELP - Running Macros in VBA Louise New Users to Excel 7 April 6th 05 03:21 PM
Running Macros simpleS Setting up and Configuration of Excel 1 February 17th 05 02:32 PM
Running Win Macros on Mac wammer[_2_] Excel Programming 4 August 7th 04 06:29 AM
HELP: Running two Macros, one before the other Bobbak Excel Programming 4 December 9th 03 01:27 PM


All times are GMT +1. The time now is 11:14 PM.

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"