I've seen several references saying that a new Excel file can be opened using VBA in Word. I'm using Office 2010 and trying to open an Excel file to display some information that the Word application will dump into Excel but I get a compile error "User-defined type not defined" on the line "Dim xlApp As Excel.Application" below.
I'm at a loss to know how to proceed as all examples look just like this but mine doesn't work. The context is that a Word 2010 .docm file will be open and the macro will run from there. Excel might or might not be running and I need to open a blank workbook that will be closed without saving after it has done its job.
Dim xlApp As Excel.Application
Dim xlRangeDisplay As Excel.Workbook
Dim xlWks As Excel.Worksheet
Dim vbProjWrd As VBIDE.VBProject
Dim vbProjXl As VBIDE.VBProject
Dim vbComp As VBComponent
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlRangeDisplay = xlApp.Workbooks.Add