Help, i'm in troubles when trying to refresh a query table. I never have this problem, but I'm using Excel 2010 file type XLSM
Sometimes works perfect, sometimes is failing, very erratic, however :
Private Sub btnClearFilters_Click()
Range("B1").Value = ""
Range("B2").Value = ""
Dim strSql As String
msgStatusOn ("Refreshing with history sales per item")
strSql = "EXEC dbo.HST_3YR_QuarterlySales 2011, 0, '',''"
Worksheets("Invoice History").Range("Table_Query_from_Sales").ListObject.QueryTable.CommandText = strSql
'----- Here is failing with this message :Run-time error '1004': Application-defined or object-defined error
Worksheets("Invoice History").Range ("Table_Query_from_Sales").ListObject.QueryTable.Refresh BackgroundQuery:=False
'----------------------------------------------
msgStatusOff
PopulateItemCombo
AddTotals
End Sub
Thank you
Sometimes works perfect, sometimes is failing, very erratic, however :
Private Sub btnClearFilters_Click()
Range("B1").Value = ""
Range("B2").Value = ""
Dim strSql As String
msgStatusOn ("Refreshing with history sales per item")
strSql = "EXEC dbo.HST_3YR_QuarterlySales 2011, 0, '',''"
Worksheets("Invoice History").Range("Table_Query_from_Sales").ListObject.QueryTable.CommandText = strSql
'----- Here is failing with this message :Run-time error '1004': Application-defined or object-defined error
Worksheets("Invoice History").Range ("Table_Query_from_Sales").ListObject.QueryTable.Refresh BackgroundQuery:=False
'----------------------------------------------
msgStatusOff
PopulateItemCombo
AddTotals
End Sub
Thank you