Creating add-ins from Excel 4 macros
Thank you for your reply.
Some further clarification and explanation seems to be needed.
Recent versions of Excel have allowed users to save most workbooks as
add-ins by selecting "Microsoft Excel Add-In" from the "Save as type"
drop-down list in the "Save as" dialogue box. But you can't do this with
Excel 4 macros. When the thing you are trying to save is an Excel 4 macro,
the "Microsoft Excel Add-In" option doesn't appear on the list. (Try it
yourself if you don't believe me). If I remember correctly, this annoying
obstruction first appeared in Excel Version 5, at the same time that
Microsoft removed the facility to record actions in Excel macro language.
The idea seems to have been to discourage users from using the intuitive,
powerful and easy-to-use macro language that was (and still is) integral to
the way Excel works, and to force us instead into using VBA, a grossly
over-complex sprawling mess of a language which has been tacked-on to Excel
in an absurdly inelegant way, and which was clearly designed by and for
professional programmers with little understanding or sympathy for the needs
of Excel users. I'm sure I'm not the only person who experimented with VBA
when it was first introduced but gave up in disgust because of its endless
unnecessary complications, the impenetrable computer-programmer's jargon in
which it was couched and, most aggravating of all, the fact that it didn't
provide any way of doing very many important things that Excel's native macro
language did naturally and without fuss.
Anyway, I digress. The point is that for many years Excel users have been
prevented from directly saving an Excel 4 macro as an add-in. There used to
be a work-around, however, in the form of the macro-sheet-only command
"=VBA.MAKE.ADDIN(filename_text)".
But this command no longer works - it causes a macro error when it is run.
If you type VBA.MAKE.ADDIN into Google, then several of the sites that come
up are related to viruses, so, as I mentioned before, I suspect Microsoft
have deliberately disabled it as an anti-virus measure.
I hope you now understand why I have turned (in desperation) to this
Microsoft Excel forum and why I have mentioned the VBA.MAKE.ADDIN command
several times. I don't know whether or not I have been "bantying" about it,
since I've never heard that word before.
You wrote "go to the vbe in that workbook and change the isaddin property of
the
thisworkbook object properties to true". You then wrote "I don't see
anywhere that those instructions involve VBA".
Since "VBE" means "Visual Basic Editor" and "VBA" means "Visual Basic for
Applications", I had assumed that the purpose of one was to edit the other.
My mistake, evidently!
I tried adapting your suggested code and running it in the Visual Basic
Editor's "immediate window", but I'm afraid it didn't work. A dialogue box
came up headed "macros" containing the name Auto_Open (even though there was
no Auto_Open macro on the macro sheet I was trying to save), and buttons
labelled "run", "cancel", "step into", "edit", "create" (button disabled) and
"delete". I ran your code five times and pressed each of the enabled buttons
in turn, but no .xla file was created.
Manually changing the "isaddin" property did seem to have an effect, though
- it made the macro sheet disappear, and when I closed Excel and reopened the
file it seemed to behave like an add-in even though its extension was still
".xls". I then changed the file's extension to ".xla" in Windows Explorer
and it seemed to work.
Is it likely to cause any problems doing it this way, do you think?
Many thanks for your help and for your patience.
Best wishes,
Graham
|