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 ObjectDim wrk As ObjectDim Sheet As ObjectDim strExcelFile As String If IsExcelRunning Then Set xls = GetObject(, "Excel.Application") Else Set xls = CreateObject("Excel.Application") End If xls.Visible = True strExcelFile = GetExcelFilename(Me.SDate, "Adult") Set wrk = xls.Workbooks.Open(strExcelFile)End Function
Set wrk = xls.Workbooks.Open(strExce