Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Which Dialog Button? (XL95 in XL2007!)

Excel 95 dialogs normally associate a macro with buttons other than OK
and Cancel. The macro runs when the button is pressed, all is good.

Except that in Excel 2007, if the *current* workbook does not have
macros enabled, then the macro does not run. This is regardless of
the the fact that the dialog is run from an authrorized, installed add-
in.

So I was hoping to be able to simply mark the button as Dismis, and
then test which button was pressed from the code that executed the
Show. But I cannot find any way to do that. Application.caller does
not have this information. No obvious Button property.

Any ideas most welcome.

Anthony

(There are good reasons to use Excel 95 dialogs, even today. Fonts
within boxes, references etc. Besides the obvious one of not wanting
to have to change a lot of code.)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Which Dialog Button? (XL95 in XL2007!)

Hi Anthony,

Except that in Excel 2007, if the *current* workbook does not have
macros enabled, then the macro does not run. This is regardless of
the the fact that the dialog is run from an authrorized, installed add-
in.


I don't think this is correct, for me it works without a problem.
Download my Autosafe from my site (see below), it is an addin that still uses
a dialog sheet (look on the addins tab to open the settings screen of Autosafe)
and it works.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com
Member of:
Professional Office Developer Association
www.proofficedev.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Which Dialog Button? (XL95 in XL2007!)

On Nov 26, 10:26*pm, Jan Karel Pieterse
wrote:
Hi Anthony,

Except that in Excel 2007, if the *current* workbook does not have
macros enabled, then the macro does not run. *This is regardless of
the the fact that the dialog is run from an authrorized, installed add-
in.


I don't think this is correct, for me it works without a problem.
Download my Autosafe from my site (see below), it is an *addin that still uses
a dialog sheet (look on the addins tab to open the settings screen of Autosafe)
and it works.

Regards,

Jan Karel Pieterse
Excel MVPhttp://www.jkp-ads.com
Member of:
Professional Office Developer Associationwww.proofficedev.com


To be clear, if the current workbook has no macros at all, then all is
well. But if the current workbook does have a macro in it, and it has
not been explicitly enabled by the user, then add-in functions
triggered by a Dialog button press will not run, and produces an
obscure error message (function not found). Definitely a bug in Excel
2007, but I cannot see a work around.

Anthony
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Which Dialog Button? (XL95 in XL2007!)

Hi Anthony,

To be clear, if the current workbook has no macros at all, then all is
well. But if the current workbook does have a macro in it, and it has
not been explicitly enabled by the user, then add-in functions
triggered by a Dialog button press will not run, and produces an
obscure error message (function not found). Definitely a bug in Excel
2007, but I cannot see a work around.


I tested this on my Excel 2007 (ouch, now I recall I have a beta SP
installed!!!) and there it works flawlessly. If it fails to work on your
machine I guess you have to wait until that Service pack is released.

Or stop using dialog sheets altogether, but use a Userform instead. I recommend
you to do that anyway. Dialog sheets may soon no longer be supported, since
they were superseded by userforms a long time ago with Excel 97.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com
Member of:
Professional Office Developer Association
www.proofficedev.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Which Dialog Button? (XL95 in XL2007!)

Hi Anthony,

To be clear, if the current workbook has no macros at all, then all is
well. But if the current workbook does have a macro in it, and it has
not been explicitly enabled by the user, then add-in functions
triggered by a Dialog button press will not run, and produces an
obscure error message (function not found). Definitely a bug in Excel
2007, but I cannot see a work around.


Forget my last message, I was wrong, it also fails on my system.

What happens if you pre-pend the macroname with the workbook name (when
assigning the macro to the button)?

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com
Member of:
Professional Office Developer Association
www.proofficedev.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Which Dialog Button? (XL95 in XL2007!)

Hi Anthony,

I filed a bug report at MSFT.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com
Member of:
Professional Office Developer Association
www.proofficedev.com

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Which Dialog Button? (XL95 in XL2007!)

On Nov 27, 5:14*pm, Jan Karel Pieterse
wrote:
Hi Anthony,

To be clear, if the current workbook has no macros at all, then all is
well. *But if the current workbook does have a macro in it, and it has
not been explicitly enabled by the user, then add-in functions
triggered by a Dialog button press will not run, and produces an
obscure error message (function not found). *Definitely a bug in Excel
2007, but I cannot see a work around.


Forget my last message, I was wrong, it also fails on my system.

What happens if you pre-pend the macroname with the workbook name (when
assigning the macro to the button)?


The workbook name seems to be prepended. And this seens to be the
case when viewed from Excl 2007. Ie.

Debug.Print ActiveWorkbook.DialogSheets("configdialog").Button s
("Button 65").OnAction
shows
SDetective_Library.xls!Public.fsUpdateLicense

Sadly the "new" Excel 97 VBA dialogs do not support the same
functionality as the old 1995 ones. So an upgrade is a trade off. I
think that I'll just live with the rather obscure bug having added a
note to the docs (which will never be read!).

Thanks for filing a bug report with Microsoft, although I doubt if it
will be acted upon.

Anthony
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Which Dialog Button? (XL95 in XL2007!)

Hi Anthony,

Sadly the "new" Excel 97 VBA dialogs do not support the same
functionality as the old 1995 ones.


I know, but most of those can be worked around.
Sometimes using one of the windows common controls helps (but those have there
own "problems").

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com
Member of:
Professional Office Developer Association
www.proofficedev.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Toggle button - procedure works but elegance needed (xl2007) Kragelund Excel Programming 4 October 25th 08 09:22 PM
addin menu button xl2007 [email protected] Excel Programming 2 July 31st 08 10:57 AM
Form button crashes XL2007 Dave Unger Excel Programming 0 October 26th 07 03:03 AM
XL2007 - Axis Scaling Dialog problem Martin Brown Charts and Charting in Excel 4 September 17th 07 02:44 PM
bring up dialog box from command button? Xtreme Hammer Action Excel Programming 1 November 11th 03 04:41 AM


All times are GMT +1. The time now is 02:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"