Importing Excel spreadsheet from the Web

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

macgibbonn
Posts: 3
Joined: Mon May 22, 2017 9:19 pm

Importing Excel spreadsheet from the Web

Postby macgibbonn » Mon Jun 05, 2017 8:51 pm

I have a program that is trying to import a spreadsheet from a webpage, but I am getting an error (screenshot of the error dialog attached) saying:

File 'C:\Users\MACGIB~1\AppData\ev_temp\hc5.xls' does not match expected format in "IMPORT HTTP://WWW.RBNZ.GOVT.NZ/-/MEDIA/RESERVE ... C5/HC5.XLS RANGE=B5:S450 COLHEAD=1 @FREQ M 1990M12".


The code I am using is:

Code: Select all

pagecreate m 1950m1 2025m6
pagerename untitled monthly

'#### This import statement from the web works fine ######
import http://www.rbnz.govt.nz/-/media/ReserveBank/Files/Statistics/tables/s33/hS33.xls range=Data!b5:ak450 colhead=1 @freq m 2016m12

''#### This import statement from the web fails #######
import http://www.rbnz.govt.nz/-/media/ReserveBank/Files/Statistics/tables/c5/hc5.xls range=Data!b5:s450 colhead=1 @freq m 1990m12

''##### But this import statement works on the file downloaded to my local network ########
import M:\hc5.xls range=Data!b5:s450 colhead=1 @freq m 1990m12


I am confused as to how I can import the file into Eviews from my local network, but not directly from the web.

Any suggestions?
Attachments
Eviews Error.png
Eviews Error.png (7.52 KiB) Viewed 10283 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Importing Excel spreadsheet from the Web

Postby EViews Gareth » Mon Jun 05, 2017 9:21 pm

The Excel file format is slightly incorrect. Doesn't matter whether you open it from the web, or from a local copy.

Excel is able to open the file (and then save in a correct format).
Follow us on Twitter @IHSEViews

macgibbonn
Posts: 3
Joined: Mon May 22, 2017 9:19 pm

Re: Importing Excel spreadsheet from the Web

Postby macgibbonn » Tue Jun 06, 2017 8:26 pm

Gareth,

Are you able to provide any further detail about what exactly was incorrect about the format of the Excel file?

It would be nice to be able to let the organisation whose file it is know the details.

Cheers
Nairn

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: Importing Excel spreadsheet from the Web

Postby EViews Jason » Wed Jun 07, 2017 10:15 am

I didn't narrow it down to which record (I think it is the first one), but one of the records in the file has a length of 16608. According the the XLS binary format specification records are not to exceed 8224.

See https://msdn.microsoft.com/en-us/library/office/gg615597(v=office.14).aspx. The 'Key Components of the MS-XLS File Format' section reads:
A record cannot exceed 8224 bytes. If the data the record applies to is larger than that, the rest is stored in one or more continue records.

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: Importing Excel spreadsheet from the Web

Postby startz » Tue Feb 02, 2021 11:23 am

If you can open it in Excel, open it there and save it under a new name. Good chance EViews will be able to read in the saved version.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 18 guests