Results 1 to 8 of 8

Thread: [RESOLVED] vb6 controls in VBA

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046

    Resolved [RESOLVED] vb6 controls in VBA

    How can I use vb6 controls (msdatagrid for example) with VBA without having VB6 installed (get licensing error otherwise)?

    Are there any similar grid controls for VBA available that are very cheap or free?
    Last edited by Muddy; Nov 15th, 2007 at 08:53 AM. Reason: resolved

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

    Re: vb6 controls in VBA

    If you click on the additional tools button on the toolbox you can "import" whatever controls you have registered on your system. You can also install the vb 6 runtime redistributable too as your VBA users will need it installed to view your userform if you plan on distributing it.
    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

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046

    Re: vb6 controls in VBA

    Thanks for the response. The problem is that if you dont have VB6 on your machine you wont have an msdatagrid registered (the control will be there, but it will complain about no license and die if you try to use it).

    I was hoping there might be a way to license those vb6 primitive controls that ship with VBA but not vb6.

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

    Re: vb6 controls in VBA

    You can register the control silently with the /s switch.
    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

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046

    Re: vb6 controls in VBA

    Quote Originally Posted by RobDog888
    You can register the control silently with the /s switch.
    so this will solve the problem?

    Start - Run - regsvr32.exe /s MSDATGRD.OCX

    Im skeptical, but will get the person I am working with to try it (I haven't got a machine without VB6 installed)

    The reason I am skeptical is that it is a design time licensing issue ... not a registration issue as far as I know. using regsvr.exe doesnt work (using no switches) so I dont understand why the silent switch would change anything.

    Thanks for the response!
    Last edited by Muddy; Oct 19th, 2007 at 05:51 PM.

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

    Re: vb6 controls in VBA

    The problem is that if you dont have VB6 on your machine you wont have an msdatagrid registered
    Im going off of that statement as if you loaded the ocx and registered it then it would be logical that the licensing issue would disappear.

    If having just the single ocx installed and registered wont prevent the licensing issue before you open Excel then perhaps installing the entire runtime redistributable would suffice?
    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

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046

    Re: vb6 controls in VBA

    Quote Originally Posted by RobDog888
    Im going off of that statement as if you loaded the ocx and registered it then it would be logical that the licensing issue would disappear.

    If having just the single ocx installed and registered wont prevent the licensing issue before you open Excel then perhaps installing the entire runtime redistributable would suffice?
    Turns out it's a licensing issue. without vb6 installed there is no design time license (although the runtime license exists) for the grid and it cannot be used in excel macros. I finally got what I needed by building a vb6 ocx wrapper with the props I needed.

    Thanks for the responses!

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

    Re: [RESOLVED] vb6 controls in VBA

    Thanks for the update. Interesting issue though. Too bad MS just didnt allow the runtime controls to be used in VBA designers.
    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

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