BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Lazygeek
Fluorite | Level 6

Hi , 

 

I am trying to export few datasets to different sheets of a excel file with the below code . It works fine but for one sheet it throws  below error. If i delete that sheet and run again it works fine. But i cannot delete that sheet because there are many other graphs that reference from the sheet. Any help is greatly appreciated. I am using SAS 9.4

 

proc export data=stattrans
outfile= "&OUTDIR.\&loan_type._&product._report.xlsx" dbms=excel2007 replace;
SHEET="DATA_&testname.stat";
run;

 

error : Can not replace sheet because it has existing formulas that reference other page

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Does the sheet being replaced have formulas?
Have you tried using a named range instead? Or a different DBMS?

View solution in original post

4 REPLIES 4
Reeza
Super User
Does the sheet being replaced have formulas?
Have you tried using a named range instead? Or a different DBMS?
Lazygeek
Fluorite | Level 6

Hi Reeza,

 

 Sorry for the late response. Changing DBMS worked. Your help is much appreciated. 🙂

 

Thanks

LzG

ChrisNZ
Tourmaline | Level 20

I prefer to have the data sheets separate from the report sheets to avoid this kind of issue and to keep things clean and simple.

If that's not an option, a named range might be another way as mentioned.

Lazygeek
Fluorite | Level 6
Hi Chris, in this case changing the DBMS worked for me. But your suggestion for using named ranges helped me to solve other issue. Kudos !! Thanks .

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4 replies
  • 1299 views
  • 2 likes
  • 3 in conversation