Jonnyoforem
New Member
- Joined
- May 22, 2015
- Messages
- 32
I've created a function that makes a new user form but when I try to name the user form I get the error; Run-Time error '75': Path/File access error. Here are the relevant portions of my code.
In my own personal troubleshooting here's what I've found.
If I do the following it works fine
I want the person calling the function to be able to name the user form though.
I also tried the following and it gave me the same Run-Time error 75
Thanks in advance for any help!
Code:
Function NewUserForm (Title)
Dim TempForm As Object
'Hide VBE window to prevent screen flashing
Application.VBE.MainWindow.Visible = False
'Create the UserForm
Set TempForm = ThisWorkbook.VBProject.VBComponents.Add (3)
TempForm.Name = Title
End Function
In my own personal troubleshooting here's what I've found.
If I do the following it works fine
Code:
TempForm.Name = "Maintenance"
I want the person calling the function to be able to name the user form though.
I also tried the following and it gave me the same Run-Time error 75
Code:
Function NewUserForm (Title)
Dim TempForm As Object
Dim tite As String
'Hide VBE window to prevent screen flashing
Application.VBE.MainWindow.Visible = False
'Create the UserForm
Set TempForm = ThisWorkbook.VBProject.VBComponents.Add (3)
TempForm.Name = tite
End Function
Thanks in advance for any help!