Help using Base SAS procedures

How to close excel prompts?

Accepted Solution Solved
Reply
Contributor
Posts: 71
Accepted Solution

How to close excel prompts?

Hello,

I am trying to export a proc tabulate results to excel file and every time I run, it prompts a window asking permission to open,save or close the file, something like "Do you want to open oe save this file? Is there a way to disable the prompt?

Below is my code

ods html file= "E:\report.xls";

Proc tabulate data=sims_data;

... ;

...;

run;

ods html close;

Thanks in advance for your help.


Accepted Solutions
Solution
‎03-25-2013 12:51 AM
Valued Guide
Posts: 634

Re: How to close excel prompts?

You are using the HTML destination to create HTML output.  The XLS extension tells windows  to open the file using excel. Although excel knows how to open an html file, it prompts you to be sure.

Consider using the excelxp tagset to save the file as an XML file.

ods tagsets.excelxp file= "c:\report.xml";

Proc tabulate data=sashelp.class;

class sex age;

var height;

table age,sex*height*mean;

run;

ods tagsets.excelxp close;

View solution in original post


All Replies
Solution
‎03-25-2013 12:51 AM
Valued Guide
Posts: 634

Re: How to close excel prompts?

You are using the HTML destination to create HTML output.  The XLS extension tells windows  to open the file using excel. Although excel knows how to open an html file, it prompts you to be sure.

Consider using the excelxp tagset to save the file as an XML file.

ods tagsets.excelxp file= "c:\report.xml";

Proc tabulate data=sashelp.class;

class sex age;

var height;

table age,sex*height*mean;

run;

ods tagsets.excelxp close;

Contributor
Posts: 37

Re: How to close excel prompts?

Hi Art, I'm too facing a similar issue. Although I divert the output to XML still I get a prompt (window named as File Download) whether to Open or Save or Cancel. Is there any option like NoPrompt or open_excel="no"? I'm using sheet_name=" " option as I got to load data into multiple tabs.

ODS TAGSETS.EXCELXP FILE ="C:\.....\FILENAME.XML";

TITLE        " Title for 1st sheet";

ODS TAGSETS.EXCELXP OPTIONS(SHEET_NAME="SUMMARY" EMBEDDED_TITLES="yes" ABSOLUTE_COLUMN_WIDTH='10,15,8,....');

   Proc Steps....

TITLE        "  ";

TITLE        " Title for 2nd sheet";

ODS TAGSETS.EXCELXP OPTIONS(SHEET_NAME="DATA" EMBEDDED_TITLES="yes" ABSOLUTE_COLUMN_WIDTH='10,15,8,....');

   Proc Steps....

TITLE        "  ";

ODS _ALL_ CLOSE;


Look forward for your valuable suggestions, Pawan

Contributor
Posts: 71

Re: How to close excel prompts?

It worked. Thank You!!

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 1341 views
  • 0 likes
  • 3 in conversation