Some columns gets blank in pivot source data

Puneet1220161

New Member
Joined
Jun 23, 2018
Messages
1
I have existing excel (ver 2010) with pivot. This excel is refreshed programmatically from c# application.

The pivot is created with OBDC with sql stored procedure (which returns the sql table after performing some business logic) to pull the data.

When the excel is refreshed programmatically from c# application it gets refreshed without any errors.

When I double click on the total of the pivot table the underlying data is displayed.

This is working fine.

Recently new columns are added in the resultset of the stored procedure.

When the excel is refreshed programmatically from c# application it gets refreshed without any errors.

When I double click on the total of the pivot table the new columns are appearing in the underlying data but now some of the existing columns are appearing completely blank (I have checked by executing the stored procedure, the data is returned properly).

If I manually refresh the pivot (by going to Data->Refresh ALL) it appears. But I want this to happen programmatically (since this columns are existing columns)

I cannot set the "Refresh Data on opening the file" as this file is send to the other users where the dsn will not be there.
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
51,405
Office Version
365
Platform
Windows
Cross-posted here: https://www.excelforum.com/excel-charting-and-pivots/1235479-some-columns-gets-blank-in-pivot-source-data.html

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 

Forum statistics

Threads
1,081,421
Messages
5,358,584
Members
400,505
Latest member
JacquiT

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top