Hi
I've created a userfom and module that I import. Then I save my Excel document on another name and open it. When i Open it and want to show my imported userform. i've made this code but that doesn't work have anyone an idea how i Can get it work
Code to import the module and the userform
VB:
--------------------------------------------------------------------------------
Sub Aut
pen()
Application.EnableCancelKey = wdCancelDisabled
ActiveWorkbook.VBProject.References.AddFromFile _
"C:\Program Files\Common Files\System\ado\msado15.dll"
ActiveWorkbook.VBProject.VBComponents.Import _
"S:\Correspondentiesysteem\Modulen\factuur.bas"
ActiveWorkbook.VBProject.VBComponents.Import _
"S:\Correspondentiesysteem\Formulieren\uitgaandecorrespondentie.frm"
Open "c:\temp.txt" For Output As #1
Print #1, "Factuur"
Close #1
ActiveWorkbook.SaveAs "C:\temp\Factuur.xls"
Workbooks.Open "C:\temp\Factuur.xls"
Application.EnableCancelKey = wdCancelInterrupt
End Sub
Code in het module factuur.bas to show the userform
VB:
--------------------------------------------------------------------------------
Sub Workbook_Open()
Uitgaandecorrespondentie.Show
End Sub
I've created a userfom and module that I import. Then I save my Excel document on another name and open it. When i Open it and want to show my imported userform. i've made this code but that doesn't work have anyone an idea how i Can get it work
Code to import the module and the userform
VB:
--------------------------------------------------------------------------------
Sub Aut
Application.EnableCancelKey = wdCancelDisabled
ActiveWorkbook.VBProject.References.AddFromFile _
"C:\Program Files\Common Files\System\ado\msado15.dll"
ActiveWorkbook.VBProject.VBComponents.Import _
"S:\Correspondentiesysteem\Modulen\factuur.bas"
ActiveWorkbook.VBProject.VBComponents.Import _
"S:\Correspondentiesysteem\Formulieren\uitgaandecorrespondentie.frm"
Open "c:\temp.txt" For Output As #1
Print #1, "Factuur"
Close #1
ActiveWorkbook.SaveAs "C:\temp\Factuur.xls"
Workbooks.Open "C:\temp\Factuur.xls"
Application.EnableCancelKey = wdCancelInterrupt
End Sub
Code in het module factuur.bas to show the userform
VB:
--------------------------------------------------------------------------------
Sub Workbook_Open()
Uitgaandecorrespondentie.Show
End Sub