Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Time error '1004': Application-defined or object-defined error PBcorn Excel Programming 7 October 2nd 08 03:38 PM
Run Time Error 1004: Application Defined or Object Defined Error BEEJAY Excel Programming 4 August 25th 08 01:52 PM
Export a chart in a GIF file. Run-time error '1004': Application-defined or object-defined error; [email protected] Excel Programming 4 September 16th 07 11:09 PM
Run Time Error 1004 - Application-defined or object-defined error brent Excel Programming 2 October 3rd 05 05:23 PM
Macro Run-time Error 1004 Application Defined or Object Defined Error Anddmx Excel Programming 6 June 9th 04 03:40 PM


All times are GMT +1. The time now is 05:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"