MrExcel Publishing
Your One Stop for Excel Tips & Solutions

ADD-INS (a macro haven)


Posted by bill.roberts on March 07, 2000 9:18 AM

ok, visit this site to create ADDIN's (XLA).

http://support.microsoft.com/support/kb/articles/Q156/9/42.ASP

Once an XLS has been saved as an ADD-IN (XLA), how do you access the macros?

None of the macros are private yet none appear in the Tools|Macros Menu.


Posted by Ivan Moala on March 07, 2000 11:48 PM


Bill
In the Thisworkbook properties
Select the Isaddin and change this to False


Ivan

Posted by bill.roberts on March 08, 2000 7:27 AM

What then is the purpose of an ADD-IN?

Microsoft says this:
http://support.microsoft.com/support/kb/articles/Q156/9/42.ASP
-----------------------------------------------------------
XL97: How to Create an Add-in File in Microsoft Excel 97

Add-in File Behavior
An add-in file in Microsoft Excel is a special type of workbook. An add-in file can contain worksheets, chart sheets, and Visual Basic for Applications macros and functions. Macros and functions in an add-in file add optional commands and features to Microsoft Excel without allowing a user to directly view or edit them.

-----------------------------------------------------------

They say implicitly that Macros are available from an ADD-IN.

How do you access them?

Posted by Ivan Moala on March 08, 2000 10:19 PM

Bill the macros are available @ load time, that is
they will run if you have an auto_run routine.
Addins are usually made so as to make available
a routine Via a button or control tool some function/s that you may want avial.

To change the program ie. make visible the macros
for editing you will need to do as I said above
to access the sheets etc.


Ivan

Posted by bill.roberts on March 09, 2000 8:58 AM


Ivan,

I am aware that making an XLS to an XLA renders the sheet invisible.

Also, I visited the MSN site about rendering an XLA visible by changing the status to NOT ISADDIN.

Strange that the file is techincally an XLA even after saving it with status NOT ISADDIN.
-----
-----
You have exactly nailed what I in your last reply.

Perhaps VISIBLE is too strong an adjective.

I DO want custom toolbars/controls/buttons linked to the "invisible" macros.

Where do I go from here?

Bill

Posted by bill.roberts on March 10, 2000 11:37 AM


Ivan,

Thank you for forwarding:

Distributing Microsoft Excel 97, Word 97, and PowerPoint 97 Solutions

Although I did NOT find the answer I was looking for there, I did find myself on the right track.

I saw that you could call a MACRO using something along the lines of:

Sub CallAddInMacro()
Application.Run "d:\My Documents\MyAddIn.ppa!MyMacro"
AddIns("MyAddIn").Loaded = False
End Sub

This applied to POWERPOINT.

Immediately, I saw that running one in EXCEL would also be possible.

So, I hit the MSDN site again and came up with this little ditty.

http://support.microsoft.com/support/kb/articles/Q115/2/08.asp

...To avoid receiving an error message when you call
...a macro that is contained in an add-in file from
...a Visual Basic procedure, do either of the
...following:

...Open the add-in file (either before you run the

...macro, or as a command in the macro), and then

...use the Run method of the Application object to

...run the macro as in the following example:

...Application.Run("ADDIN.XLA!Macro_Name")

Merry X-mas 2 U !!