ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using macros in an external worksheet (https://www.excelbanter.com/excel-programming/387745-using-macros-external-worksheet.html)

dch3

Using macros in an external worksheet
 
What is the best way to setup Excel if I need to access macros in an external
worksheet and run them in a variety of worksheets? I tried saving them in a
..xls worksheet and then setup Excel to open the worksheet when the app opens,
but the worksheet is always displayed. Should I save the worksheet as a *.xla
and then add it as an add-in?

dq

Using macros in an external worksheet
 
Set the property ThisWorkbook.IsAddin to true and the book will be
hidden.

DQ


dch3

Using macros in an external worksheet
 
And just where would I place the statement? Which event procedure?

"dq" wrote:

Set the property ThisWorkbook.IsAddin to true and the book will be
hidden.

DQ



dq

Using macros in an external worksheet
 
You can do this either manually or put it in the Workbook_Open event.
(in the ThisWorkbook codepane)

DQ


dch3

Using macros in an external worksheet
 
So how is this different from saving the workbook with the macro as a .xla
file and then using Tools AddIns to add it to the workbooks in which it
needs to run?

"dq" wrote:

You can do this either manually or put it in the Workbook_Open event.
(in the ThisWorkbook codepane)

DQ



dq

Using macros in an external worksheet
 
Simple: not so much work


dch3

Using macros in an external worksheet
 
Would you please reread my last post. Your most recent response did not
answer the question.

"dq" wrote:

Simple: not so much work



Dave Peterson

Using macros in an external worksheet
 
I would save the file as an addin so the workbook will be hidden when it opens.

But then I'd have to give the users (myself???) some way of running those
procedures.

For additions to the worksheet menu bar, I really like the way John Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)

=======
If you're going to save this addin with others and you have UDF's called from
cells in a worksheet, then I'd save the addin (DCH3Utils.xla) in a common
location -- a shared folder and tell the users to install the addin using the
UNC path name (not a mapped letter).

If that's not possible, then I'd tell the users to save it to the same folder
name:

C:\MyAddins\dch3utils.xla

Then tools|addins|browse and install it from there.



dch3 wrote:

What is the best way to setup Excel if I need to access macros in an external
worksheet and run them in a variety of worksheets? I tried saving them in a
.xls worksheet and then setup Excel to open the worksheet when the app opens,
but the worksheet is always displayed. Should I save the worksheet as a *.xla
and then add it as an add-in?


--

Dave Peterson

dch3

Using macros in an external worksheet
 
Thx - that's what I've been looking for.

"Dave Peterson" wrote:

I would save the file as an addin so the workbook will be hidden when it opens.

But then I'd have to give the users (myself???) some way of running those
procedures.

For additions to the worksheet menu bar, I really like the way John Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)

=======
If you're going to save this addin with others and you have UDF's called from
cells in a worksheet, then I'd save the addin (DCH3Utils.xla) in a common
location -- a shared folder and tell the users to install the addin using the
UNC path name (not a mapped letter).

If that's not possible, then I'd tell the users to save it to the same folder
name:

C:\MyAddins\dch3utils.xla

Then tools|addins|browse and install it from there.



dch3 wrote:

What is the best way to setup Excel if I need to access macros in an external
worksheet and run them in a variety of worksheets? I tried saving them in a
.xls worksheet and then setup Excel to open the worksheet when the app opens,
but the worksheet is always displayed. Should I save the worksheet as a *.xla
and then add it as an add-in?


--

Dave Peterson



All times are GMT +1. The time now is 12:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com