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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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