BookmarkSubscribeRSS Feed
KimLeBouton
Quartz | Level 8

Has anyone been able to get the following example, http://support.sas.com/rnd/base/ods/odsmarkup/msoffice2k/index.html#multiple, to work with either SAS 9.13 or SAS 9.2 (TS2M3) and Excel 2003?

Even after fixing the syntax error, Excel reports back that the spreadsheet has a serious error.

TIA,

Kim LeBouton

2 REPLIES 2
art297
Opal | Level 21

Kim,

Don't tell Vince, but I've been able to avoid tagsets all of these years.  However, that said, if you post your code and a sample data set, I'd be glad to take a look.

Art

Andre
Obsidian | Level 7

Kim,

i have tried the sample under 9.2.3  with the minor correction

and  the opening was without problems under excel2010

and after transportation of the file upon a pc whith excel2003

the htm file  (even with a .xls suffix) was opening well

perhaps has the office 2003 the addon for reading  .xlsx files

but in our matter as the code is html, i have no idea why you have had trouble

HTH

Andre

procsort data=sashelp.classout=test;

  by age;

  run;

  ods tagsets.msoffice2k path="d:\temp" file="temp.html" newfile=output;

  proc print data=test;

  by age;

  run;

  ods tagsets.msoffice2k close;

  ods tagsets.msoffice2k_x file="d:\temp\tempmultiple.xls" style=statistical

      options(worksheet_source="11#d:\temp\temp.html,

                                12#d:\temp\temp1.html,

                                13#d:\temp\temp2.html,

                                14#d:\temp\temp3.html,

                                15#d:\temp\temp4.html,

                                 16#d:\temp\temp5.html"

              );

  data _null_;

    file print;

    put "test";

  run;

  ods tagsets.msoffice2k_x close;

the content of tempmultiple.xls   is  the following text

<html xmlns:x="urn:schemas-microsoft-com:office:excel">

<head>

<meta name="Excel Workbook Frameset">

<meta name="Generator" content="SAS Software Version 9.2, see www.sas.com">

<meta http-equiv="Content-type" content="text/html; charset=windows-1252">

<title>SAS Output</title>

<style type="text/css">

<!--

-->

</style>

<script language="javascript" type="text/javascript">

<!--

function startup(){

}

function shutdown(){

}

//-->

</script>

<!--[if gte mso 9]><xml>

<x:ExcelWorkbook>

<x:ExcelWorksheets>

<x:ExcelWorksheet>

<x:Name>11</x:Name>

<x:WorksheetSource HRef="d:\temp\temp.html"/>

</x:ExcelWorksheet>

<x:ExcelWorksheet>

<x:Name>12</x:Name>

<x:WorksheetSource HRef="d:\temp\temp1.html"/>

</x:ExcelWorksheet>

<x:ExcelWorksheet>

<x:Name>13</x:Name>

<x:WorksheetSource HRef="d:\temp\temp2.html"/>

</x:ExcelWorksheet>

<x:ExcelWorksheet>

<x:Name>14</x:Name>

<x:WorksheetSource HRef="d:\temp\temp3.html"/>

</x:ExcelWorksheet>

<x:ExcelWorksheet>

<x:Name>15</x:Name>

<x:WorksheetSource HRef="d:\temp\temp4.html"/>

</x:ExcelWorksheet>

<x:ExcelWorksheet>

<x:Name>16</x:Name>

<x:WorksheetSource HRef="d:\temp\temp5.html"/>

</x:ExcelWorksheet>

</x:ExcelWorksheets>

<x:WindowHeight>12495</x:WindowHeight>

<x:WindowWidth>18900</x:WindowWidth>

<x:WindowTopX>60</x:WindowTopX>

<x:WindowTopY>45</x:WindowTopY>

<x:ProtectStructure>False</x:ProtectStructure>

<x:ProtectWindows>False</x:ProtectWindows>

</x:ExcelWorkbook>

</xml><![endif]-->

</head>

<body onload="startup()" onunload="shutdown()" class="Body" style=" text-align: center;">

<script language="javascript" type="text/javascript">

<!--

var _info = navigator.userAgent

var _ie = (_info.indexOf("MSIE") > 0

          && _info.indexOf("Win") > 0

          && _info.indexOf("Windows 3.1") < 0);

//-->

</script>

<div class="branch">

<a name="IDX"></a>

<h1 class="SystemTitle">Le Système SAS</h1>

<div>

<div align="center">

<table cellspacing="0" cellpadding="0" summary="Page Layout">

<tr><td>

<pre class="Batch" style=" padding: 7px; border-spacing: 1px; border: 1px solid #000000; text-align: left;">test                                                                                                    

</pre></td></tr>

</table>

</div>

</div>

<br>

</div>

</body>

</html>

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1302 views
  • 0 likes
  • 3 in conversation