Hi,
I used to be able to run the PROC EXPORT code below without any issues but now SAS gives me an error. I suspect it is because IT just installed a maintenance release. Do you think it is the reason and is there an option to avoid this error?
proc export data=final
outfile="\\fileshare\users\rm\example5.xlsx"
dbms=xlsx replace ;
sheet="Data_import";
run;
I Get the error message:
Can not replace sheet because it has existing formulas that reference other pages
ERROR: Export unsuccessful. See SAS Log for details.
This error is mentioned in in "SAS/ACCESS(R) 9.4 Interface to PC Files: Reference, Third Edition" EXPORT Procedure
"If you use the EXPORT procedure with DBMS=XLSX and the page has formulas that reference other pages, an error message is written to the log. The error states that the page cannot be replaced because it has formulas that reference other pages."
I have seen this error,
"Can not replace sheet because it has existing formulas that reference other pages",
even in cases where the sheet did not contain any formulas. We are currently experiencing problems with Proc Export corrupting Excel files. My understanding was that this was supposed to have been fixed in 7.12 HF2 but we are still seeing issues. It would be really great if someone were to include a link to that support issue because I'm not finding anything about it on this site. I can only conclude that I'm not looking in the right places because our issue is replicable.
Hi, is there any progress on this? I keep getting the error even when there are clearly NO formulas in the sheet into which the data are exported (but obviously there are formulas in other sheets which link to these data, that is the whole point of using an Excel template).
EDIT: It seems the workaround for me is to export data to CSV, and then use Excel connections feature, which link certain ranges in an Excel workbook with external CSVs. The advantage of this method is that you may link ranges anywhere in the given sheet, that means that you can have charts/formulas on the same sheet as your imported data, which is not possible with the SAS xlsx proc export.
What SAS 9.4 maintenance release are you on? It is supposed to be fixed in 9.4 M4.
Looks like this SAS note is relevant:
http://support.sas.com/kb/58/890.html
You might want to check Maintenance 4 (SAS 9.4 TS1M4) when it is released in the next week or so to see if this is now fixed.
A workaround would be to replace formulas with values using Paste Special.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.