japss
October 23rd, 2002, 06:06 AM
Can anyone please tell me how to read an excel file from VBScript(server-side)
The piece of code(vbscript-serverside) im using is given below. This code throws an error on the first line like
Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid ProgID. For additional information specific to this message please visit the Microsoft Online Support site located at: http://www.microsoft.com/contentredirect.asp.
/poc/ExcelToJs/uploadForm.asp, line 68
So, can anyone please tell me what is the actual ProgId or do i need to set something on the server
But visual basic accepts this Excel.Application ProgId
Set XL = Server.CreateObject("Excel.Application")
Set WB = XL.Workbooks.Open("E:\OBB\example.xls")
For i = 1 To WB.Sheets.Count
Set WS = WB.Sheets.Item(i)
Set r = WS.UsedRange
sRows = r.Rows.Count
i = 2
Do While i < sRows
sName(i - 2) = WS.Cells(i, 1)
semail(i - 2) = WS.Cells(i, 1)
Response.Write WS.Cells(i, 1)
Response.Write WS.Cells(i, 14) & "<br>"
i = i + 1
Loop
Next
Thankx in advance
The piece of code(vbscript-serverside) im using is given below. This code throws an error on the first line like
Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid ProgID. For additional information specific to this message please visit the Microsoft Online Support site located at: http://www.microsoft.com/contentredirect.asp.
/poc/ExcelToJs/uploadForm.asp, line 68
So, can anyone please tell me what is the actual ProgId or do i need to set something on the server
But visual basic accepts this Excel.Application ProgId
Set XL = Server.CreateObject("Excel.Application")
Set WB = XL.Workbooks.Open("E:\OBB\example.xls")
For i = 1 To WB.Sheets.Count
Set WS = WB.Sheets.Item(i)
Set r = WS.UsedRange
sRows = r.Rows.Count
i = 2
Do While i < sRows
sName(i - 2) = WS.Cells(i, 1)
semail(i - 2) = WS.Cells(i, 1)
Response.Write WS.Cells(i, 1)
Response.Write WS.Cells(i, 14) & "<br>"
i = i + 1
Loop
Next
Thankx in advance