I have a "wide" SAS data sets that must be exported into a new Excel workbook every week. I want to preserve the column widths and other Excel attributes every week, but I'm having problems getting it to work. Here's what I'm attempting.
- I used PROC EXPORT to create a new workbook (using sheet="New_TACs").
- I manually adjusted the column widths and other sheet attributes (like "filters", column widths, wrap, alignment, and "freeze panes").
- I deleted all the data rows (leaving the first row with the column names) and saved it as a new workbook named "template.xlsx".
- Using a SAS system call, I copy "template.xlsx" to "this_week.xlsx". I use PROC EXPORT again to try and update the new workbook, but I get warnings. The result contains a sheet named "New_TACS1".
Here is the SAS log:
720 proc export data=new_tacs
721 outfile="\\server-path\this_week.xlsx"
722 replace;
723 sheet='New_TACs';
724 run;
WARNING: The target file may contain unmatched range name and sheet name.
WARNING: The target file may contain unmatched range name and sheet name.
WARNING: File _IMEX_.New_TACs.DATA does not exist.
WARNING: Table _IMEX_."New_TACs" has not been dropped.
NOTE: "New_TACs" range/sheet was successfully created.
NOTE: PROCEDURE EXPORT used (Total process time):
real time 23.88 seconds
cpu time 1.80 seconds
I'm at a loss as to what to do and would appreciate any ideas or suggestions.