Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 14th, 2005, 02:21 PM
Authorized User
 
Join Date: Sep 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default running macro/user form from other excel files

Hi -

I have few questions on this macro, that I have written that provides forms for data entry and processes batch, which will be used by multiple users at the same time.

1, Is it possible to allow the user to access this macro at the same time? If not, any recommendations as what I can do to allow the sharing access?

2. In this same workbook, I've also created a sheet consisted of reference data that I have assigned names and used by the macro which calls the user form that uses these name data. However, sometimes if I have other excel workbooks open and accidentally run the macro (using custom menu) with other workbooks active, the userform will open but cann't reference the data name I have linked them with. Is there a way I can reference these names in the macro so that macro can be executed successfully from any excel workbook, not just from the one contains the macro and user form?

Thanks.
Kathy
 
Old February 21st, 2005, 05:35 AM
Authorized User
 
Join Date: Jan 2005
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Kathy,

It's just to tell you that your question was interesting, I am surprized that so far no replies have come so far, I know that it's possible to invoke macros from one VBA project to another, you will have to write like this:
Workbooks("GMSFINANCE-TOOLBAR.xls").RunAutoMacros xlAutoOpen
or
Application.Run "'GMSFINANCE-TOOLBAR.xls'!PrintSetup"

For sharing thing I have yet to do R&D, will write once I succeed

Regards
Amjad Mahmood Email:amjad.s.mahmood@gsk.com

 
Old April 7th, 2005, 11:06 AM
Registered User
 
Join Date: Mar 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Regarding accessing macros in one workbook from any other open workbook thru' a custom menu. It strikes me that your best option might be to convert the workbook containing the macro to an Add-In and then install the Add-In so that it loads any time Excel is opened. To convert to an Add-In you open the work book and do a Save As and change Save as Type to Microsoft Excel Add-In (*.xla). You then use Tools|Add-Ins... to install the Add-In so that it will be loaded whenever Excel opens. This should allow you unrestrained access to the Add-In from any workbook. Just ensure that in the Add-In macro code if you want to refer to something in the macro's own workbook access through the ThisWorkbook object and if you want to access something in any arbitrary active workbook use the ActiveWorkbook object.

Cheers
nic






Similar Threads
Thread Thread Starter Forum Replies Last Post
Probs while running macro anukagni Excel VBA 2 February 2nd, 2006 03:29 AM
stop macro from running on EVERY cell change!! forkliftpete Beginning VB 6 1 October 26th, 2005 07:36 AM
Excel 2000 vs Excel 2002 Macro Issue williadn Excel VBA 1 July 14th, 2005 09:09 AM
Show Sheet after running macro sridevi Excel VBA 2 November 5th, 2004 08:18 AM
Strange error when running macro in multiple files medaugh Excel VBA 0 September 15th, 2003 11:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.