0

I am trying to read as web-page content an excel file. I thought going through vbscript in classic ASP.

But ...The code is taking so long to open and when it works, the page comes in blank! That should I do please?

<%

Dim xls  
response.ContentType="application/vnd.ms-excel"
Set xls = CreateObject("Excel.application")

xls.Visible = False

xls.Workbooks.Open("R:\wb\excel\Middleware.xls") 

%>

And I tried also:

<% 

Set opena = CreateObject("Excel.Application")
opena.Application.Workbooks.Open "R:\wb\excel\Content.xls"

%>
Keith
  • 20,636
  • 11
  • 84
  • 125
0x69676f72
  • 31
  • 5
  • Have you tried using the JET database driver? - https://support.microsoft.com/en-us/kb/195951 – John Oct 19 '15 at 17:59
  • http://stackoverflow.com/questions/15285880/how-to-reference-microsoft-office-interop-excel-dll would appear to be a similar question. – JB King Oct 19 '15 at 19:40
  • I rather to instance the excel file than parse the excel content by using ADO – 0x69676f72 Oct 19 '15 at 20:34

1 Answers1

0

You definitely do not want to use Office Automation in a server-side. You might want to look at: https://support.microsoft.com/en-us/kb/257757

I would instead strongly recommend that you use to the new formats (.xlsx) and instead use OpenXML on the server which will be a lot easier/safer/scalable to use.

If you are stuck with .xls then another option is use the old XML format, and I actually wrote a library to generate Excel XML files that you could try if you wanted: http://www.carlosag.net/tools/excelxmlwriter/

but bottomline I would definitely stay away from Office automation as you are using above, and instead use other libraries that generate the binary formats (either XLS or OpenXML even better if you can use newer version of Office).

Carlos Aguilar Mares
  • 13,411
  • 2
  • 39
  • 36