On Nov 27, 4:27*pm, "Héctor Miguel" <NOhemiordiS...@PLShotmail.com>
wrote:
> hi, Anthony !
>
> > Ie. The add-in (ThisWorkbook) is enabled (otherwise the exercise is pointless)
> > but are the macros in the ActiveWorkbook enabled?
> > (I want to know this to warn the user about the fact that Excel 95 Dialogs
> > do not work if the Active workbook has Macros and they are disabled
> > (even though those ActoveWorkbook macros are never actually called). A bug in Excel 2007.)
>
> one way...
> the workbook for which you need to know it's macro-status needs to be the"activeworkbook"...
> (tested for xl 97 to 2007)
>
> Function ActiveWorkbookMacroStatus() As Boolean
> * ActiveWorkbookMacroStatus = _
> * * Application.CommandBars("exit design mode").Visible
> End Function
>
Thanks for that, looks like a classic hack. But I could not make it
work in ANY version of Excel (it only needs to work onXL07 for me).
It is false always, unless I explicitly make the commandbar visible,
in which case it is true always.
I also tried Application.Run (ThisWorkbook.Name & "!
aaDummyMethodToRun"); but this always works even if the ActiveWorkbook
is not runnable.
One hack that should work is to send keystrokes to the dialog and see
if a method is invoked. But that is very ugly and somewhat unstable.
Anthony
|