I have Excel 2003 and 2010 on my machine so when I use set xlapp = new excel.application it creates a new Excel 2003 application. My work around is to create a new Excel 14 application using shell. It works but I need to open an existing excel file to reference the object later.
I would like to reference the object without opening an existing file. Is there any way to reference the new Excel app without using the file name. Below is code for an existing file. Please show me the correct way to do this.
Dim MyApp As Excel.Application
TaskID = Shell("C:\Program Files\Microsoft Office\Office14\EXCEL.EXE "C:\Book2.xlsx", vbNormalFocus)
Set MyApp = GetObject("C:\Book2.xlsx").Application
You can create it ans close Excel …
Would that work for you? See here original solution: Create an Excel file using vbscripts