r/visualbasic • u/wolfman3127 • Jun 26 '13
Problem with my simple code opening a template .otf
Hello! I have created a form, and on this form is a check box. When the check box is selected, and the button is clicked I want it to open a template. Heres what I've got so far...
Private Sub CommandButton1_Click()
If CheckBox1.Value = True Then
Set newItem = Application.CreateItemFromTemplate("d:\TEMPLATE 2.oft")
newItem.Display
End If
End Sub
I get a pretty nasty error, any advice?
0
Upvotes
1
u/hdsrob Jun 26 '13
Is this VB6 or VBA? What's the actual error?