none
How to save any form as an OCX file extension for import? RRS feed

  • Question

  • Hello again,

    I have multiple versions of Microsoft Office - namely versions 2000, 2010, and 2016.

    Can anyone provide me more information on how to save forms as Active X for import to other IDEs?

    For example:

    I want to save a form (.frm) with the corresponding class files (.cls) and basic file (.bas) extensions and save all of them for

    exporting to other versions of Visual Basic IDEs.

    Thanks in advance for your responses.

    Regards,

    JohnDBCTX


    jp


    • Edited by JohnDBCTX Saturday, November 18, 2017 4:57 AM
    Saturday, November 18, 2017 4:56 AM

Answers

  • I've only used Office 2003, 2007, 2010 and 2013 but I've never had a problem exporting .bas, .frm and .cls files and importing them into a newer version.  For Excel I generally use Code Cleaner to export everything and selectively import what I want.
    • Marked as answer by JohnDBCTX Wednesday, November 22, 2017 10:40 AM
    Saturday, November 18, 2017 2:50 PM
  • You can't save a userform as an ActiveX  / OCX. FWIW an 'MSForms' userfom can be imported for use in say a VB6 dll or ocx but that's beyond the scope of this forum.

    You can export a userform from the VBE's UI, File/Export, or right click on project / Export. Or you can simply drag from Project Explorer to file, you can also use code to export the file. You can import the form from file to any VBA project in the same ways.

    Two files are created when you export a userform, .frm (header + form code) and .frx (definition of controls + properties). Only import the .frm, the frx must also exist and will be imported automatically with the .frm

    • Marked as answer by JohnDBCTX Wednesday, November 22, 2017 10:41 AM
    Monday, November 20, 2017 8:56 AM
    Moderator
  • No, this is only possible in VB 6. Office VBA environments cannot create ActiveX DLL or EXE components.

    Paul ~~~~ Microsoft MVP (Visual Basic)

    • Marked as answer by JohnDBCTX Wednesday, November 22, 2017 10:40 AM
    Monday, November 20, 2017 2:38 PM

All replies

  • I've only used Office 2003, 2007, 2010 and 2013 but I've never had a problem exporting .bas, .frm and .cls files and importing them into a newer version.  For Excel I generally use Code Cleaner to export everything and selectively import what I want.
    • Marked as answer by JohnDBCTX Wednesday, November 22, 2017 10:40 AM
    Saturday, November 18, 2017 2:50 PM
  • You can't save a userform as an ActiveX  / OCX. FWIW an 'MSForms' userfom can be imported for use in say a VB6 dll or ocx but that's beyond the scope of this forum.

    You can export a userform from the VBE's UI, File/Export, or right click on project / Export. Or you can simply drag from Project Explorer to file, you can also use code to export the file. You can import the form from file to any VBA project in the same ways.

    Two files are created when you export a userform, .frm (header + form code) and .frx (definition of controls + properties). Only import the .frm, the frx must also exist and will be imported automatically with the .frm

    • Marked as answer by JohnDBCTX Wednesday, November 22, 2017 10:41 AM
    Monday, November 20, 2017 8:56 AM
    Moderator
  • No, this is only possible in VB 6. Office VBA environments cannot create ActiveX DLL or EXE components.

    Paul ~~~~ Microsoft MVP (Visual Basic)

    • Marked as answer by JohnDBCTX Wednesday, November 22, 2017 10:40 AM
    Monday, November 20, 2017 2:38 PM