Error querying Excel Spreadsheet - Help Please!

Results 1 to 3 of 3

Thread: Error querying Excel Spreadsheet - Help Please!

  1. #1
    Join Date
    Dec 1969

    Default Error querying Excel Spreadsheet - Help Please!

    I have an excel spreadsheet that I am uploading and querying using ASP, SQL. I have one row that has a rather large field. When I try to query the spreadsheet I get this error at that row:<BR><BR>[Microsoft][ODBC Excel Driver] The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data. <BR><BR>However, if I move the row up, so that it is one of the first 8 rows, I don&#039;t get the error and everything runs fine. If the row is below the first 8 I get the error. I can make the error go away by making the field smaller (i.e. deleting some text out of it) but this is frustrating because there is another row that is nearly the same size and never gives me an error. I have to trim the row that gives me an error to be smaller than the row that doesn&#039;t give me an error. I&#039;d think trimming it to just the same size would do the job...<BR><BR>Anyway, why does the location of the row matter???<BR><BR>Thanks.<BR>Johnny.

  2. #2
    Join Date
    Dec 1969

    Default RE: Error querying Excel Spreadsheet - Help Please

    Johnny,<BR><BR>Sorry, I don&#039;t have an answer. Instead I&#039;d like to know how you are reading an excel spreadsheet from ASP. I&#039;ve been trying to use ADO and server.createobject, but I can&#039;t seem to nail down the open connection parameter... Any clue?<BR><BR>Thanks,<BR>Mike Sanders<BR> <BR>

  3. #3
    Ed Guest

    Default Javascript... Cut and pasted...

    try<BR>objExcel = new ActiveXObject("Excel.Sheet") ;<BR>}<BR>catch( objLocalException )<BR>{ <BR>throw objLocalException ;<BR>}<BR> <BR>objExcel.Application.Visible = true ;<BR> <BR>if( strType == "Excel:)<BR>objExcel.Application.Workbooks.Open("& #060;%= WEBURL %&#062;ExcelTemp/ExcTemp.XLT") ;<BR>objExcel.Application.Range("Date1") = "&#060;%= Date() %&#062;" ;<BR>objExcel.Application.Range("Date2") = "&#060;%= Date() %&#062;" ;<BR>objExcel.Application.Range("Date3") = "&#060;%= Date() %&#062;" ;<BR>objExcel.Application.Worksheets.PrintPreview( ) ; <BR>objExcel.Application.ActiveWorkbook.SaveAs( strFileName ) ;<BR><BR>}<BR><BR>// close out excel. <BR>objExcel.Application.DisplayAlerts = false ;<BR>objExcel.Application.Quit() ;<BR>objExcel = null ;<BR>}<BR><BR>Or something like that...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts