OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Thread Tools Search this Thread Display Modes
Old 04-05-2005, 15:26
Posts: n/a
Default Problem with Common Dialog in Corel VBA

Here is a trivial snippet of code that runs happily on my computer, and some client computers, but not on others.

Sub UploadAnalyzer()
Dim dlgBrowse As CommonDialog
Dim myDoc As Document
Dim myRefText As Shape
Dim myRefText2 As Shape

Set dlgBrowse = New CommonDialog


The error occurs on the " Set dlgBrowse = New CommonDialog" statement. The error is "Run-Time Error '429' ActiveX component can't create object."
All my references appear to be correctly set in the project, and the comdlg32.ocx is registered as far as I can tell.

As a test, I created a VB app that does nothing but open the common dialog 'Open' window and installed it on a mis-behaving computer. The dialog opened correctly from my VB app, so the OCX is working ok.

Any Ideas?

Rob Cohen
Reply With Quote
Old 04-05-2005, 15:37
Posts: n/a

Oops I should have noted that we are running Corel11.
Reply With Quote
Old 04-05-2005, 17:28
Alex's Avatar
Alex Alex is offline
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4

How did you "install" your test VB application? Could it be that while you install it, the common dialog OCX is also installed? As far as I know, things like Common control and common dialog libraries are not part of standard install. They do come standard with stand-alone VB and Visual Studio but you can't rely on them being on user machine.

When you go to Tools>References or Toolbox>Custom controls, which library for common dialogs are you referencing? Is it the same version as in your test VB application?
Reply With Quote
Old 13-05-2005, 14:43
Posts: n/a
Default Solution Found

It turns out that the Common Dialog is a licensed product! My development machine has a license on it, but this particular client machine did not. I am suprised that I hadn't encountered this problem before.

The workaround-

instead of

set myDLG = New CommonDialog
with mydlg

I embedded a common dialog control onto a form defined just for this purpose.
so my code now looks like
with frmDialog.Commondialog1
This change is enough to make VBA happy to invoke this control. Pretty simple to fix, but frustrating to uncover.
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW-TO call coreldraw12 find dialog from VBA code???? wOxxOm CorelDRAW/Corel DESIGNER VBA 4 02-03-2008 08:32
Corel Photo Paint 11 Document Events problem cyrilgupta Corel Photo-Paint VBA 1 07-11-2004 12:51
Problem with opened dialog box Corel Draw 11 dergy CorelDRAW/Corel DESIGNER VBA 1 14-06-2004 10:04
Bug in Corel 12 VBA oswaldon CorelDRAW/Corel DESIGNER VBA 1 24-04-2004 21:14
VBA Editor Problem j_lyver CorelDRAW/Corel DESIGNER VBA 2 31-03-2003 05:30

All times are GMT -5. The time now is 21:00.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com