Hi I have code that opens a existing excelfile. Se below But how to open a new file, must I have the path to a *,xlt file?
//Anders
//Anders
Code:
Dim MyXL As Object
Dim objConn As OLEDBWorkspaceFactory
Set MyXL = GetObject(, "Excel.Application")
If Err.Number <> 0 Then ExcelWasNotRunning = True
Err.Clear ' Clear Err object in case error occurred.
Set MyXL = GetObject("C:\Projekt\data.xls")
Set MyXL = Nothing