Results 1 to 13 of 13

Thread: [RESOLVED] How easily select a path

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2006
    Posts
    14

    Resolved [RESOLVED] How easily select a path

    Hi,

    I've already seen in VB a control in the toolbox that allow me to select a path and a file by browsing in my computer with an automatic dialog window such as the one in attachment.

    But now, I don't have it on my tool box and I can't find it within the references and the additional controls.

    How may I find or call this kind of dialog box ?
    Thanks!
    Attached Images Attached Images  

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How easily select a path

    It is called a Common Dialog Control and can be found under Components.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2006
    Posts
    14

    Re: How easily select a path

    Thanks,

    I found it. But when I want to insert that control on my form, an error message ay that the control cannot be created because it is not properly licensed...

    Any clue of wath I can do ?

    I'm using VBA with Flexpro (a data acquisition and analysis software)

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How easily select a path

    Quote Originally Posted by croto
    Thanks,

    I found it. But when I want to insert that control on my form, an error message ay that the control cannot be created because it is not properly licensed...

    Any clue of wath I can do ?

    I'm using VBA with Flexpro (a data acquisition and analysis software)
    If you are using VBA, then your post should be in the Office Development section, which is where I just moved it. The reason is simple: There are a number of coding differences and responses you may get with VB6 code may not work with VBA.

    In terms of the Common Dialog Control in a VBA environment, I don't know what the answer to your issue is, but I'm sure one of the folks that hang out in Office Development will.

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2006
    Posts
    14

    Re: How easily select a path

    Thanks Hack. And sorry for the inconvenience, I'm new there!

    Now I wait an answer from someone here!

  6. #6
    Lively Member
    Join Date
    Jun 2005
    Posts
    112

    Re: How easily select a path

    I've never used FlexPro, but VBA has a way of accessing common dialog controls in every application I've used it with.

    In Excel you would use
    VB Code:
    1. Application.GetOpenFileName
    In Word you would use
    VB Code:
    1. Application.Dialogs(wdDialogFileOpen).Display
    I'm sure FlexPro has a similar dialog if you dig around.

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: How easily select a path

    If you r getting a license error then look at these two ms links.

    http://support.microsoft.com/default...b;EN-US;194751
    http://support.microsoft.com/kb/177799/EN-US/

    Otherwise mikeyc1204's post is the VBA way.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  8. #8

    Thread Starter
    New Member
    Join Date
    Jan 2006
    Posts
    14

    Re: How easily select a path

    Well..
    There is no way to do it with mikeyc1204's method in Flexpro (I've dg a lot!) and RobDog888 link's are great but they need to have VB6.0 installed. And I don't.

    I tried to post my question on Flexpro's forum... I'll wait for their answer.
    Thanks again

  9. #9
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: How easily select a path

    If Flexpro supports MS VBA then perhaps the links will work if you add the CDL control to your toolbox after registering the .ocx only?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  10. #10

    Thread Starter
    New Member
    Join Date
    Jan 2006
    Posts
    14

    Re: How easily select a path

    No.. I tried and there's nothing to do with that

  11. #11

    Thread Starter
    New Member
    Join Date
    Jan 2006
    Posts
    14

    Re: How easily select a path

    Here is the reply that Flexpro's support just gave me :

    You need a design-time license for the "Common Dialog Control". This design time license comes together with VB 6.0, unfortunately not with VBA.
    So if you have VB installed on your system you can use the control also in VBA. If you redistribute a VBA project which uses the control and you simply install (copy+register) the control on the target machine it will work fine at run-time. On the other hand you will not be able to add a new instance of the control on the target machine.

    To get the dialog box without the "Common Dialog Control" is possible, as the functionality is provided by a Windows API. This requires some more work, see for instance http://www.activevb.de/tipps/vb6tipps/tipp0368.html for a VB-example. This should basically work also with VBA.
    I tried the Windows API thing, but it seem a lot too hard for me...

  12. #12
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: How easily select a path

    Oh, we have examples of it on the forums too. Its not hard at all. Place it in a module and just call from anywhere.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  13. #13
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: How easily select a path

    Here's something I posted a while ago...

    VB Code:
    1. Dim dlgOpen As FileDialog
    2.     Set dlgOpen = Application.FileDialog( _
    3.         FileDialogType:=msoFileDialogOpen)
    4.     With dlgOpen
    5.         .AllowMultiSelect = True
    6.         .Show
    7.     End With
    8.  
    9.  For Each i in dlgopen.selecteditems
    10.  
    11.  'Insert your code here - changing the filenames to "i"
    12.  
    13.  Next i


    from this thread.


    HTH

    zaza

Posting Permissions

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



Click Here to Expand Forum to Full Width