Search : in
By :

Macro error -Current page method of pivot fie

austin316, on Oct 20, 2009 3:08:46 pm BST 
 Report this message to moderators

Hello,

I am migrating my excel macros from 2003 to 2007. The excel macro was working fine with 2003. But now when I run a particular report, in 2007 sometimes I am getting the error like “Run time Error 2157417848(80010108) Method ‘CurrentPage’ of object ‘Pivot ‘Failed “
I don’t know what the reason for this error is. Sometimes only am getting this error and sometimes the macro is working very fine.


Private Sub RTS_Change()
Dim tempStr As String
tempStr = RTS.text
ColumnRTS = "J"

Application.ScreenUpdating = False

If (tempStr <> "All") Then
Module1.PasteValuesInPricelistColumn tempStr, ColumnRTS
Sheets("History Report").Select
ActiveSheet.Unprotect
ActiveSheet.PivotTables("HistoryPivot").PivotFields("R T S").CurrentPage = tempStr
Module1.pivotTableUpdate
Else
Sheets("History Report").Select
ActiveSheet.Unprotect
Module1.pivotTableUpdate
End If
End Sub


In the above code, in "RTS.text" RST is the name of the combobox Im using in the report. I have removed the multiple use of "ActiveSheet." and gave the sheet name directly itself, then also the same error. I have ran the report for the same criteria, then again am getting error sometimes and sometimes not. tempStr will always contain the value as "(All)". Please provide me help on this issue, as am hangup with this for the past 1 month.

Thanks in advance.

-Austin

Configuration: Windows XP Internet Explorer 7.0, MS office 2007

Best answers for « Macro error Current page method of pivot fie » in :
Excel tips : How to insert date in a cell ShowExcel tips : How to insert date in a cell Below are some tips on how to insert date and time in an excel cell for a specific purpose:- To insert current date, press CTRL ¯+ ;¯ in the chosen cell. To insert current time, press CTRL¯+...
Windows 7: the main keyboard shortcuts ShowWindows 7: the main keyboard shortcuts Some shortcuts that allow the user to save time The main key is Windows. Windows key + (+) gives you a magnifying option. The pressing (+) consecutively increase the current page, the minus...
Can't open secure websites ShowCan't open secure websites Issue Solution Issue It happens that some secure (https://) websites can't be opened on Internet Explorer or other browsers. You can get this error "The page cannot be displayed". This because these...
Error checking ShowError checking Binary encoding is very practical for use in electronic devices such as computers, in which information can be encoded based on whether an electrical signal is present or not. However, this electrical signal may suffer disturbances...
PERT method ShowPERT Method The PERT method is a technique that allows you to manage the scheduling of a project. The PERT method consists of graphically representing a network of tasks, which, when placed in a chain, can lead to the achievement of the...