View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Thomas Huang Thomas Huang is offline
external usenet poster
 
Posts: 2
Default Problem in Excel 2007 when Range beyond 65536 in SELECT statement

Dear friends,

Below is a function that used for testing in Excel 2007 VBA.

------------------------------------------------------
Sub aa()

Set conn = CreateObject("ADODB.Connection")
conn.Open "provider=Microsoft.ACE.OLEDB.12.0;extended properties='excel 12.0;imex=1';data source=" & ThisWorkbook.FullName

Sql = "select A,B from [sheet1$A66000:E66005]"

Sheet1.Range("A2").CopyFromRecordset conn.Execute(Sql)

End Sub
-------------------------------------------------------

The range [sheet1$A66000:E66005] is not work and error occured. Is it possible to make it work?
Thank you in advance! :)