I am trying to create a UserForm X. If, for whatever reason, form X 
already exist, I want to remove it and re-create it again. 

Sounds simple, right? 
Here's the code: 

Dim TempForm As Object ' VBComponent 
On Error Resume Next 
    Set TempForm = ThisWorkbook.VBProject.VBComponents("Bob") 
    ThisWorkbook.VBProject.VBComponents.Remove TempForm 
On Error GoTo 0 
    'Set TempForm = Nothing 
    Set TempForm = 
ThisWorkbook.VBProject.VBComponents.Add(vbext_ct_MSForm) 
    ThisWorkbook.VBProject.VBComponents(TempForm.name).name = "Bob" 

Last line gives me a "Run time error 75: path file access error"... 

Any suggestion? 

And, before you ask, even god have less privilege than me on that 
machine... 

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to