LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Run macro in another workbook

Just to add:

Single quotes is the answer for you as Chip stated, but blanks alone don't
require them. This ran fine for me

Sub RunOrganize()
Application.Run "My - Test - book.xls!OrganizeData"
End Sub

when I changed the name to My - Text - (b) & ook.xls, then I needed single
quotes.

--
Regards,
Tom Ogilvy

"Chip Pearson" wrote in message
...
If the name contains blanks, you need to enclose the file name
within single quotes. E.g.,

Application.Run "'Other Workbook Name.xls'!MacroName"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"konpego" wrote in message
...
I have tried this but it seems to be some problem.....

Are there any restrictions on the WB name?
My name contains blanks, minus-sign, parenthesis.
Is this allowed?

Best Regards

konpego

"Tom Ogilvy" wrote:

If you don't have reference from the calling workbook to the
workbook with
the macro, you would use application.Run

application.Run "OtherWorkbookName.xls!Macro1"

--
Regards,
Tom Ogilvy


"konpego" wrote in message
...
Hi,

I have two WBs open and are updating/merging data from one
to the other. I
want to run a macro in one WB to create data on a specific
WS. The results
shall be copied from the WB into the other.
To generate the data there is a pushbutton on one WS
(connected to a
macro).
The resulting data is gathered on another WS, that is to be
copied to the
other WB.

How can I execute a macro in another WB (in VB)?

/konpego









 
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
saving macro from workbook to Personal Macro Workbook KrispyData Excel Discussion (Misc queries) 1 March 25th 10 05:52 PM
Combine worksheets in multiple workbook in one workbook with a macro Sam Commar Excel Discussion (Misc queries) 2 April 2nd 09 01:09 PM
Macro to copy an image (or picture) from one workbook to a new sheetin another workbook Ruchir Excel Worksheet Functions 1 July 25th 08 07:29 AM
Need a macro to copy a range in one workbook and paste into another workbook Paul Excel Programming 8 July 1st 04 07:42 AM
Excel Gurus = want a macro in 1 workbook to get info from another workbook = Read please harry Excel Programming 5 December 20th 03 03:26 AM


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