1

I have tried to extracting data from excel file but I am getting the below error

Microsoft VBScript runtime error '800a0046' Permission denied: 'Createobject' /myaspclassic/rdexl.asp, line 3

My code is

<%'initialize variables
Dim Objexcel, ObjWorkbook, ObjDriverSheet, Columncount, Rowcount
Set Objexcel = Createobject("Excel.Application")
Set ObjWorkbook = ObjExcel.WorkBooks.Open("D:\MyExcelDB2.xls")
Set ObjDriverSheet = ObjWorkbook.Worksheets("Sheet1")
Columncount = ObjDriverSheet.Usedrange.Columns.Count
Rowcount = ObjDriverSheet.Usedrange.Rows.Count
For I = 1 To Colunmcount
  Columnname = ObjDriversheet.Cells(I,1)
  If Columnname = Knowncolumnname Then
     For J = 1 To Rowcount
       Fieldvalue = Objdriversheet.Cells(J,I)
     Next
  End If
Next
%>
user692942
  • 16,398
  • 7
  • 76
  • 175
  • Do you have permission to open that file? Check the Anonymous User Account settings in the IIS Manager. Also if this is Classic ASP use `Server.CreateObject()` not `CreateObject()`. – user692942 Jul 06 '22 at 14:07
  • I use Server.CreateObject() , but a new error '80070005' /myaspclassic/rdexl.asp, line 3 is shown – Nithin Varghese Jul 07 '22 at 03:59
  • Does this answer your question? [Retrieving the COM class factory for component failed](https://stackoverflow.com/a/25380260/692942) – user692942 Jul 07 '22 at 06:32
  • The duplicate answer is not correct, you need to use the data access compontants - this is the correct answer: https://stackoverflow.com/questions/4157575/asp-and-ms-access-db-how-to-import-data-from-xls-file – silver Jul 09 '22 at 01:42

0 Answers0