VBScript Create and Show UserForm
I have programmed some Excel VBA and now I'm testing VBScript. I'm trying to create a form/window and after a while I managed to create this code: Dim ExApp ExApp = CreateObject("Excel.Application") 'ExApp.Application.Visible = True Dim Workbook Set Workbook = ExApp.Workbooks.Add Dim myForm Set myForm = Workbook.VBProject.VBComponents.Add(3) Workbook.VBProject.VBComponents.Add(1).CodeModule.AddFromString "Function getForm()" & vbNewLine & "Set getForm = " & myForm.Name & vbNewLine & "End Function" Dim userForm Set userForm = ExApp.Run("getForm") 'VBA.UserForms.Add(myForm.Name).Show It currentl
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.