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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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