Hi, I have some code that returns a runtime error.
The runtime error I receive is below.
VBA Code:
Private Sub Workbook_Open()
Dim answer As VbMsgBoxResult
answer = MsgBox("Is this your first time using this spreadsheet?", vbYesNo + vbQuestion, "Instructions")
If answer = vbYes Then 'All works up to this point
Dim wordapp
Dim strFile As String
strFile = "C:\Users\STron\Desktop\Instructions for cable list.docx"
Set wordapp = CreateObject("word.Application")
wordapp.documents.Open strFile
wordapp.Visible = True
wordapp.Activate
Else
Worksheets("Sheet2").Activate
End If
End Sub
The runtime error I receive is below.