Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run-Time error 1004 Application defined or object defined error -
I have an Excel 2007 application that connects to an OLAP database using a
pivot table. When the user changes a list box value in the workbook I refresh the pivot table, which generates a new OLAP query. Works fine until the spreadsheet sits for more than about 5 minutes, then I get a "Run-Time error 1004 Application defined or object defined error" on the first ActiveSheet line. Sub Update_CarrierDetailData(ByVal CurrentMarket As String, ByVal CurrentSector As String) Dim strCurrentSheet As String Dim strCurrentCell As String strCurrentSheet = ActiveSheet.Name strCurrentCell = ActiveCell.Address Sheets("CarrierDetail").Select ActiveSheet.PivotTables("PivotTable2").PivotFields ( _ "[Carrier].[Market].[Market]").ClearAllFilters ActiveSheet.PivotTables("PivotTable2").PivotFields ( _ "[Carrier].[Market].[Market]").CurrentPageName = _ "[Carrier].[Market].&[" & CurrentMarket & "]" ActiveSheet.PivotTables("PivotTable2").PivotFields ( _ "[Carrier].[Sector].[Sector]").CurrentPageName = _ "[Carrier].[Sector].&[" & CurrentSector & "]" Sheets(strCurrentSheet).Select Range(strCurrentCell).Select End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run Time error '1004': Application-defined or object-defined error | Excel Programming | |||
Run Time Error 1004: Application Defined or Object Defined Error | Excel Programming | |||
Export a chart in a GIF file. Run-time error '1004': Application-defined or object-defined error; | Excel Programming | |||
Run Time Error 1004 - Application-defined or object-defined error | Excel Programming | |||
Macro Run-time Error 1004 Application Defined or Object Defined Error | Excel Programming |