如何从 SAS 中删除 Excel 工作簿的选项卡?
我有以下宏:
%macro export_set_excel(data,tabname);
PROC EXPORT DATA= &data. OUTFILE= "&results." DBMS=EXCEL REPLACE;
SHEET=&tabname.;
RUN;
%mend export_set_excel;
我的问题是,有时此宏不会删除已存在的选项卡。无论如何,从 SAS 中,我可以检查选项卡是否存在,如果存在则将其删除?
I have the following macro:
%macro export_set_excel(data,tabname);
PROC EXPORT DATA= &data. OUTFILE= "&results." DBMS=EXCEL REPLACE;
SHEET=&tabname.;
RUN;
%mend export_set_excel;
My problem is that sometimes this macro doesn't delete the tab if it already exists. Is there anyway, from SAS, that I can check if a tab exists and delete it if it does?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用下面的宏通过 DDE 删除 Excel 中的工作表。它要求您要从中删除工作表的工作簿是 Excel 中当前活动的工作簿。
You can use the below macro to delete a worksheet in Excel via DDE. It requires that the workbook that you want to delete the sheet from is the currently active workbook in Excel.