DATA Step, Macro, Functions and more

ODS HTML Excel Error

Reply
Contributor
Posts: 42

ODS HTML Excel Error

Hi,

 

I have multiple tabulates within my SAS code but when I come to connect it in excel via the web connection, I get this error message

 

This file could not be accessed. Try one of the following:

- Make sure the specific folder exisits

- Make sure the folder contains the file is not read only

- Make sure the file name does not contain any of the following charecters < > ? [  ] : | or *

- Make sure the file/path name doesn't contain more than 218 charecters

 

All of these seem fine so I am at a loss as to why it won't work. Any ideas please? 

 

This is the HTML SAS String used 

ods html body="X:/location/Dep/Area/KTY.HTML" style=HTMLBlue;

 

Then closed off the tabulate with 

run;
ods html close;

 

I have tried to open it with Internet explorer and Chrome but neither work. 

Regular Contributor
Posts: 249

Re: ODS HTML Excel Error

[ Edited ]
Posted in reply to Brandon16

Hi Brandon,

Try this instead

ODS HTML path='X:\location\Dep\Area\' body='KTY.HTML'
Contributor
Posts: 42

Re: ODS HTML Excel Error

I get this error message when running with that code 

 

'body=
___
22
202
16 ! 'KTY.HTML'
ERROR 22-322: Syntax error, expecting one of the following: ;, (, ANCHOR, ARCHIVE, ATTRIBUTES, BASE,
BODY, CHARSET, CLOSE, CODE, CONTENTS, CSS, CSSSTYLE, ENCODING, FILE, FRAME, GFOOTNOTE,
GPATH, GTITLE, HEADTEXT, IMAGE_DPI, LAYOUT, METATEXT, NEWFILE, NOGFOOTNOTE, NOGTITLE,
OPTIONS, PACKAGE, PAGE, PARAMETERS, PATH, RECORD_SEPARATOR, RENDER, STYLE, STYLESHEET,
TEXT, TRANTAB.
ERROR 202-322: The option or parameter is not recognized and will be ignored.

Regular Contributor
Posts: 249

Re: ODS HTML Excel Error

[ Edited ]
Posted in reply to Brandon16

But it works fine for me Smiley Frustrated

ods html path='C:\Users\Wong\Desktop\' body='cars.html';
proc print data=sashelp.cars; run;
ods html close;

 

7    ODS HTML path='C:\Users\Wong\Desktop\' body='cars.html';
NOTE: Writing HTML Body file: cars.html
8    proc print data=sashelp.cars; run;

NOTE: There were 428 observations read from the data set SASHELP.CARS.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.48 seconds
      cpu time            0.31 seconds


9    ods html close;








 

 

Contributor
Posts: 42

Re: ODS HTML Excel Error

I think the issue is on our drive, I have moved location and it now works fine. Thanks anyway.
Ask a Question
Discussion stats
  • 4 replies
  • 85 views
  • 0 likes
  • 2 in conversation