Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Mar 2002
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Accessing Common Dialogs (VBA6, Excel 2000)

    Am low level user of VBA6 and VB5. Currently distribute basic utilities to team members to automate various tasks. Please excuse any ignorance that follows.

    Would be extremely useful to be able to have access to Common Dialogs in Excel code modules. While am able to do so easily on own box - having corrected registration problems with controls in VB5 - am unable to get same code to execute on other boxes.

    Currently using the following code:

    Dim FileDialog As Object
    Set FileDialog = CreateObject("MSComDlg.CommonDialog")

    This code works on own box, but generates error "429: ActiveX component can't create object" on those boxes without VB5 installed.

    Any thoughts on causes and solutions?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Accessing Common Dialogs (VBA6, Excel 2000)

    Can you confirm that the problem machines do not have a registry entry under HKEY_CLASSES_ROOT for MSComDlg.CommonDialog? If so, then the question would be whether you are licensed, as an owner of VB5, to redistribute that control as part of your solution. If you are, you can create a package with the deployment wizard to install and register the control on the user's machines.

    If they do have this in their registries, then I'd check on the Knowledge Base to see if there are any unusual problems. (For example, there was a problem with MSForms and/or DAO in Office 97 if portions of Office were not installed, or something like that...)

  3. #3
    New Lounger
    Join Date
    Mar 2002
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Accessing Common Dialogs (VBA6, Excel 2000)

    Thanks for help!

    Spot testing problem machines indicates that registry entry DOES exist. However, since posting, have found problem is avoided by calling API, rather than OCX. Refer http://www.mvps.org/vbnet/index.html?code/...fileopendlg.htm. Some compromises made on options, but referred code more than sufficient for purpose.

    (Extension problem: the referred code does not work within Cyprus Enable. Anyone have experience of working with Common Dialog and/or API calls in Enable?)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •