In MS Access I want to first check to see if Excel is open. If so, check to see if a certain workbook is already open. If not open it, otherwise set the open workbook as the active workbook.
Here is what I have so far. Almost there but if it is already open it gives a warning about re-opening an open workbook.
Private Function UpdateCrisisChart()
Dim xls As Object
Dim wrk As Object
Dim Sheet As Object
Dim strExcelFile As String
If IsExcelRunning Then
Set xls = GetObject(, "Excel.Application")
Set xls = CreateObject("Excel.Application")
xls.Visible = True
strExcelFile = GetExcelFilename(Me.SDate, "Adult")
Set wrk = xls.Workbooks.Open(strExcelFile)