Create excel file when another excel file are open.
Posted on 2008-11-10
I'm using this command to create an excel file:
DoCmd.DeleteObject acQuery, varQuery
Set varQryDef = CurrentDb.CreateQueryDef(varQuery, varSQL)
DoCmd.OpenQuery varQuery, acViewNormal, acReadOnly
If DCount("*", varQuery) > 0 Then
varExcelCreated = True
DoCmd.Close acQuery, varQuery
Set myXL = GetObject(, "Excel.Application")
Set xlBook = myXL.ActiveWorkbook
Set xlSheet = xlBook.Worksheets(1)
Is it a problem if another instance of excel are open while doing this?