SYSTEM: Windows 8.1 Tablet, VS 2012
OLD SYSTEM: Windows 7, VS 2013 Enterprise (thanks to my employer)
Something is wrong. I never had any errors on my old system. On my new system, I'm getting the following:
An unhandled exception of type 'System.Exception' occurred in Microsoft.VisualBasic.dll
Additional information: Cannot create ActiveX component.
So I'm not sure why it can't create the ActiveX component. I'm trying to open Word to create a file. The error appears at the oWord = CreateObject("Word.Application"). Here is some code:
Imports System.IO
Imports Microsoft.Office.Interop
Imports Microsoft.Office.Interop.Word
Public Class clsPrint
#Region "====================== PRINT REPORT COVER SHEET ======================"
Public Sub printFrmReportCoverSheet()
Dim oWord As Word.Application
Dim oDoc As Word.Document
oWord = CreateObject("Word.Application")
oWord.Visible = True
oDoc = oWord.Documents.Add(x.myReportCoverSheetFormWordFile)
frmProgressBar.Text = "Your report is being built.."
frmProgressBar.ProgressBar1.Increment(25)
oDoc.Bookmarks.Item("case").Range.Text = frmReportCoverSheet.txtCase.Text
oDoc.Bookmarks.Item("datetime").Range.Text = frmReportCoverSheet.txtDateTime.Text
------ AND SO ON-------
oWord.PrintPreview = True ' print preview mode
oWord = Nothing
oDoc = Nothing
End Sub
#End Region
End Class
For my references, I'm using:
Interop.Microsoft.Office.Interop.Word
Interop.Microsoft.Office.Core
Interop.Microsoft.Office.Core
Any ideas?
Do I need my app to create an ActiveX.dll and include it?
Thanks