VBA and ComDlg32.ocx

W

William

Hi,

I put a button on Excel's sheet and open a Common Dialog box.

I created and run it well on some PCs with Excel9.0/Excel10.0/Excel11.0.

But it failed on one of WindowsXP Pro. SP2/Excel11.0. It said that
"Microsoft Common Dialog 6.0 can not be used", though ComDlg32.ocx is
there(\Windows\system32).

Then, on this special PC, I tried as follows,
(1) Open Excel
(2) input a controller and choose "Microsoft Common Dialog 6.0"
(3) put it on Sheet1

At this time, Excel said "The object can not be inserted".

Please help me to solve the problem?

Thanks

William
 
H

Harald Staff

Hi William

Those compinents must be more than "there", they must be licensed to run in
designtime, usually meaning that some developer tool is bought and installed
on the computer. This behavior may not be consistent, but a potential
problem it is.

But what do you need the common dialog for ? Color is hardly interesting in
Excel, and VBA has good Open and Save dialogs available.

HTH. Best wishes Harald
 
W

William

Thanks Harald.

In fact, my client's company just bought some DELL PCs with Office 2003
installed.
These Software are installed by DELL not by the users. The software are
almost the same with each other.
But the problem only happens to one PC. I know I can solve the problem if I
re-install the system but the client don't want to re-install the system
because he has too many files on the PC.

You mean I need a license to use ComDlg32.ocx? Please tell me what kind of
license I need? Why I can use ComDlg32.ocx on other PCs without any
problems?

Any suggestion?

I have to use ComDlg32.ocx within Excel because I need the Excel to be able
to handle binary file, that can not be open by normal Open.

William
 
W

William

In fact, my client's company just bought some DELL PCs with Office 2003
installed.
These Software are installed by DELL not by the users. The software are
almost the same with each other on these PCs.
But the problem only happens to one PC. I know I can solve the problem if I
re-install the system but the client don't want to do like this
because he has too many files on the PC.

Any suggestion?

William
 
H

Harald Staff

You mean I need a license to use ComDlg32.ocx? Please tell me what kind of
license I need? Why I can use ComDlg32.ocx on other PCs without any
problems?

Any suggestion?

No, sorry.
I have to use ComDlg32.ocx within Excel because I need the Excel to be able
to handle binary file, that can not be open by normal Open.

Try this little thing instead:

Sub tester()
Dim F As Variant
F = Application.GetOpenFilename
If F = False Then
MsgBox "You cancelled"
Else
MsgBox "You chose " & CStr(F)
End If
End Sub

HTH. best wishes Harald
 
W

William

Thanks Harald. you solved my problem.
The following suggestion works for me.

Thank you very much!
William
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top