ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Populating cell from database (1031 characters) (https://www.excelbanter.com/excel-programming/410831-populating-cell-database-1031-characters.html)

Tim

Populating cell from database (1031 characters)
 
Hi Folks, I am trying to populate a worksheet from an access front end (SQL
server backend) with the following code. Some data is long text (1031 chars
and more) and it throws an error:

Has anyone succeeded with this sort of thing?

Thanks

Tim

"Application defined or Object defined error"

Do Until rs.EOF
For lCol = 0 To rs.Fields.Count - 1
oXL.Cells(lRow + 1, lCol + 1) = rs(lCol)
Next
lRow = lRow + 1
rs.MoveNext
Loop


Gary Keramidas

Populating cell from database (1031 characters)
 
excel 2003
Length of cell contents (text) 32,767 characters. Only 1,024 display in a
cell; all 32,767 display in the formula bar


excel 2007
Total number of characters that a cell can contain 32,767 characters


which version are you using?

--


Gary


"Tim" wrote in message
...
Hi Folks, I am trying to populate a worksheet from an access front end (SQL
server backend) with the following code. Some data is long text (1031 chars
and more) and it throws an error:

Has anyone succeeded with this sort of thing?

Thanks

Tim

"Application defined or Object defined error"

Do Until rs.EOF
For lCol = 0 To rs.Fields.Count - 1
oXL.Cells(lRow + 1, lCol + 1) = rs(lCol)
Next
lRow = lRow + 1
rs.MoveNext
Loop




Tim

Populating cell from database (1031 characters)
 
Thanks Gary, Excel 2003 is the version.

The catch is that it actually throws an error when there is a large text
field (eg memo).

"Application defined or Object defined error"

"Gary Keramidas" wrote:

excel 2003
Length of cell contents (text) 32,767 characters. Only 1,024 display in a
cell; all 32,767 display in the formula bar


excel 2007
Total number of characters that a cell can contain 32,767 characters


which version are you using?

--


Gary


"Tim" wrote in message
...
Hi Folks, I am trying to populate a worksheet from an access front end (SQL
server backend) with the following code. Some data is long text (1031 chars
and more) and it throws an error:

Has anyone succeeded with this sort of thing?

Thanks

Tim

"Application defined or Object defined error"

Do Until rs.EOF
For lCol = 0 To rs.Fields.Count - 1
oXL.Cells(lRow + 1, lCol + 1) = rs(lCol)
Next
lRow = lRow + 1
rs.MoveNext
Loop






All times are GMT +1. The time now is 02:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com