Guys,
I am getting this error when trying to set DisplayAlerts in excel to false. This has been working fine for months, why would it suddenly stop working ? It still creates the excel document OK after this error.
Thanks
Bob
Error: QueryInterface for interface Microsoft.Office.Interop.Excel._Application failed.
Err No:13Stack Trace:
at Microsoft.Office.Interop.Excel.ApplicationClass.set_DisplayAlerts(Boolean RHS)
This is my code that gets Excel....
VB Code:
Dim xl As Excel.Application Try Try xl = GetObject(, "Excel.Application") Catch ex As Exception xl = New Excel.Application End Try Dim wkbk As Excel.Workbook Dim wkst As Excel.Worksheet xl.DisplayAlerts = False 'FAILS HERE #### xl.Visible = False Dim docpath As String wkbk = xl.Workbooks.Open(TemplateLocation) wkst = wkbk.Sheets(1)




Reply With Quote