D
dj100
could you give me some advice?
my platform is office 2003 (english) Sp1. Please see attachment fo
details
Usuallly I use Ado and "select * from [sheet1$]" to deal with som
database in excel spreadsheet. but I found the vba program will b
stopped if one cell of some text field include a lot of characters.
have tested it. I found if the number of all characters in one cell i
less than or equal to 911, it is okay. But if the number is bigge
than 911, then vba will be stoped.
show:
run-time error : -2147467259 (80004005)
Method copyfromrecordset of object range failed
my code is :
Sub inputdata()
Dim x As Object
Dim yy As Object
Dim sql As String
Dim mysheet As Object
Set x = CreateObject("ADODB.Connection")
x.Open "Provider= Microsoft.Jet.OLEDB.4.0;Extended Properties=Exce
8.0;Data Source=" & ThisWorkbook.FullName
Set mysheet = Sheet2
sql = " select * from [sheet1$] "
Set yy = x.Execute(sql)
mysheet.Cells(1, 1).CopyFromRecordset yy
Set x = Nothing
Set yy = Nothing
End Sub
I do not how to upload my excel spreadsheet in this forum. if someon
knows, please help me. You could leave a email, I could send th
spreadsheet to you, you can test.
by the way, to my surprise, my chinese friend, who use officexp, o
office 2003 (chinese) can run the program in excel no problem. th
result can correct even the number of characters in one cel
increases to 9000.
could you give me some feedback. thank you
my platform is office 2003 (english) Sp1. Please see attachment fo
details
Usuallly I use Ado and "select * from [sheet1$]" to deal with som
database in excel spreadsheet. but I found the vba program will b
stopped if one cell of some text field include a lot of characters.
have tested it. I found if the number of all characters in one cell i
less than or equal to 911, it is okay. But if the number is bigge
than 911, then vba will be stoped.
show:
run-time error : -2147467259 (80004005)
Method copyfromrecordset of object range failed
my code is :
Sub inputdata()
Dim x As Object
Dim yy As Object
Dim sql As String
Dim mysheet As Object
Set x = CreateObject("ADODB.Connection")
x.Open "Provider= Microsoft.Jet.OLEDB.4.0;Extended Properties=Exce
8.0;Data Source=" & ThisWorkbook.FullName
Set mysheet = Sheet2
sql = " select * from [sheet1$] "
Set yy = x.Execute(sql)
mysheet.Cells(1, 1).CopyFromRecordset yy
Set x = Nothing
Set yy = Nothing
End Sub
I do not how to upload my excel spreadsheet in this forum. if someon
knows, please help me. You could leave a email, I could send th
spreadsheet to you, you can test.
by the way, to my surprise, my chinese friend, who use officexp, o
office 2003 (chinese) can run the program in excel no problem. th
result can correct even the number of characters in one cel
increases to 9000.
could you give me some feedback. thank you