ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CommonDialog control issue (https://www.excelbanter.com/excel-programming/338326-commondialog-control-issue.html)

Rob Docherty

CommonDialog control issue
 
I'm having trouble deploying a macro which uses the CommonDialog control.

Initially I was having trouble deploying the macro as the CommonDialog
control would only work (when placed on the worksheet) if VB was installed on
the machine.

I then read somewhere (http://www.kbalertz.com/kb_281848.aspx) that the
control could be included in a UserForm as it would then count as a run time
control rather than design time one.

This works fine on 97 but when run on a machine with 2000 (but no VB), we
get the following issue:

&H80004005 (-2147467259)

I'm thinking this may be an occurrence of this:

http://support.microsoft.com/default...b;en-us;230888

Is there another method to contain the CommonDialog control rather than
using UserForms?

Tom Ogilvy

CommonDialog control issue
 
to the best of my knowledge, it always counts as a being in design mode when
run in an office app and you need a design time license. You will need to
use the commondialog API.

If you are just doing a fileopen or filesaveas, then use
Application.GetOpenFileName
or
Application.GetSaveAsFileName

--
Regards,
Tom Ogilvy


"Rob Docherty" wrote in message
...
I'm having trouble deploying a macro which uses the CommonDialog control.

Initially I was having trouble deploying the macro as the CommonDialog
control would only work (when placed on the worksheet) if VB was installed

on
the machine.

I then read somewhere (http://www.kbalertz.com/kb_281848.aspx) that the
control could be included in a UserForm as it would then count as a run

time
control rather than design time one.

This works fine on 97 but when run on a machine with 2000 (but no VB), we
get the following issue:

&H80004005 (-2147467259)

I'm thinking this may be an occurrence of this:

http://support.microsoft.com/default...b;en-us;230888

Is there another method to contain the CommonDialog control rather than
using UserForms?




Rob Docherty

CommonDialog control issue
 
Thanks Tom, Application.GetOpenFileName does what I need just fine.

Rob

"Tom Ogilvy" wrote:

to the best of my knowledge, it always counts as a being in design mode when
run in an office app and you need a design time license. You will need to
use the commondialog API.

If you are just doing a fileopen or filesaveas, then use
Application.GetOpenFileName
or
Application.GetSaveAsFileName

--
Regards,
Tom Ogilvy


"Rob Docherty" wrote in message
...
I'm having trouble deploying a macro which uses the CommonDialog control.

Initially I was having trouble deploying the macro as the CommonDialog
control would only work (when placed on the worksheet) if VB was installed

on
the machine.

I then read somewhere (http://www.kbalertz.com/kb_281848.aspx) that the
control could be included in a UserForm as it would then count as a run

time
control rather than design time one.

This works fine on 97 but when run on a machine with 2000 (but no VB), we
get the following issue:

&H80004005 (-2147467259)

I'm thinking this may be an occurrence of this:

http://support.microsoft.com/default...b;en-us;230888

Is there another method to contain the CommonDialog control rather than
using UserForms?






All times are GMT +1. The time now is 05:40 PM.

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