I'm attempting to add a new tab to a multipage userform however I want the change to be permanent and still be there the next time I run the program.
I found a way to add in a tab but that only worked for that runtime. Then I found the code that follows and changed my trust settings to trust access to the VBA Project Model, however I keep encountering that the Object doesn't support this property?
Sub Test()
Dim vbComp As Object
Dim objCntrl As Control
Set vbComp = ThisWorkbook.VBProject.VBComponents("TabStripUserForm")
Set objCntrl = vbComp.Designer.Controls("ProductListTabStrip")
'add page
objCntrl.Pages.Add
'remove page
objCntrl.Pages.Remove (1)
End Sub
I want it to add a another tab to the userforms multipage however it says that the Object doesnt support this property or method. I've triple checked that the name of the userform and multipage are correct.