BookmarkSubscribeRSS Feed
wildhogs
Calcite | Level 5
Hello

I am taking over the maintenance of a SAS reporting program that updates 21 existing excel workbook files using DDE.

Each Excel Workbook file contains:

a. 4 worksheets that have 4 charts each
b. 4 worksheets that contain one report each
c. 1 worksheet that contains 11 pivot tables
d. 1 worksheet that contains 4 pivot tables.

The existing program uses DDE to update an Excel Model file and then it saves it under the current months name.

Question

I would like to retrieve a list of all the pivot table names that exist in the excel file and then perform a refresh on each pivot table using DDE.

This would save me over 315 manual pivot table refreshes!

Does anyone out there know how to do this?


some code to retrieve the list of pivot tables...

put '[pivot.refresh("PivotTable5")]';

PS.

I would have liked to use the refresh on open, however, my clients do not have
access to the external files.
1 REPLY 1
Petersi
Calcite | Level 5
I'm not sure if this helps, but I recently had to write a program to identify all the chart objects in a workbook. You can find out a lot about a workbook using the topics dde triplet:

filename xltopics dde'excel|system!topics' lrecl=32000;

data _null_;
length topic $ 1000;
infile xltopics pad dsd notab dlm='09'x;
input topic $ @@;
put topic=;
run;

A good reference is Excel Exposed: Using Dynamic Data Exchange to Extract Metadata from MS Excel Workbooks by Koen Vyverman. You can find it and more of his papers at

http://www.sas-consultant.com/professional/papers.html

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1920 views
  • 0 likes
  • 2 in conversation