BookmarkSubscribeRSS Feed
tom12122
Obsidian | Level 7

Hi,

I have existing Excel file with one worksheet with some graphs. I need to make many copies of this worksheet using SAS and to preserve existing objects.

I thought about calling worksheets.copy VBA command but I somehow can't get it working:

options noxwait noxsync missing=' ' ;

/* Invoke Microsoft Excel. */

X "C:\Program Files\Microsoft Office\Office12\EXCEL.EXE";

data _null_;

rc = sleep(8);

run;

filename sas2xls dde 'excel|system';

data _null_;

file sas2xls;

put "[open(""C:\xls\test2.xls"", 0 , true)]";

put "[Sheets(""Sheet2"").Select]";

put "[Sheets(""Sheet2"").Copy Before:=Sheets(1)]";

run;

Can someone help me?

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 0 replies
  • 1920 views
  • 1 like
  • 1 in conversation