Thank you for your reply. Here is the code and some reference is made why its done, where it may not seem logical
Sub OzoneData()
Dim objXL As Excel.Application
Dim objWkb As Object
Dim objSht As Object
Dim db As Database
Dim boolXl As Boolean
Dim cRows As Integer
Dim strQtr As String
Const conMAX_ROWS = 20000
Const conSHT_NAME1 = "Ozone"
Const conSHT_NAME2 = "NetOfficeOzone"
DoCmd.SetWarnings False
DoCmd.Echo False, ""
'######################################################################################
Const conWKB_NAME = "H:\Chem\DATA\XMLReport\MewsData.xls"
'Check if Excel is running
'I need to check if Excel is running and then Quit the aplication. If the create
'option is used to open an instance, the NetOffice add-in is not included and it is needed
'for this particular module. All other modules do not require the NetOffice add-in and
'can use the normal CreateObject function
'
If fIsAppRunning("Excel") Then
Set objXL = GetObject(, "Excel.Application")
boolXl = True
objXL.Quit
Set objXL = Nothing
End If
'I need to do the following three steps. If I rem them out Excel opens but without the
'NETOffice add-in and as such do not extract the data required.
Call Shell("Excel")
Excel.Application.Quit
Set objXL = Nothing
On Error Resume Next
Set objXL = GetObject(, "Excel.Application")
boolXl = True
Set db = CurrentDb
'#####################################################################
'Set the object variable to reference the file you want to see.
'MsgBox "Extracting data from Process Net", vbInformation
With objXL
.Visible = True 'False
Set objWkb = .Workbooks.Open(conWKB_NAME)
On Error Resume Next
Set objSht = objWkb.Worksheets(conSHT_NAME2)
objWkb.Worksheets(conSHT_NAME2).Activate
.Cells(1, 3).Value = Format(Forms![frmQueryDates]![BeginningDate], "mmm dd, yyyy") & " 08:00:00"
.Cells(2, 3).Value = Format(Forms![frmQueryDates]![EndingDate] + 1, "mmm dd, yyyy") & " 07:59:59"
objXL.Run "OzoneTransfer"
Set objSht = objWkb.Worksheets(conSHT_NAME1)
objWkb.Worksheets(conSHT_NAME1).Activate
With objSht
.Cells(1, 16).Value = "=COUNT(A1:A6500)"
cRows = .Cells(1, 16).Value
End With
DoCmd.TransferSpreadsheet acImport, 8, "sheet1", conWKB_NAME, True, "Ozone!A1

" & cRows
DoCmd.OpenQuery "qryOzoneFinalReport", acViewNormal, acReadOnly
End With
objWkb.Save
DoCmd.SetWarnings True
DoCmd.Echo True, ""
Set objXL = Nothing
Set objWkb = Nothing
objXL.Quit
Set objSht = Nothing
End Sub