ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can't assign to Array .GetRows in Excel 97 (https://www.excelbanter.com/excel-programming/302354-cant-assign-array-getrows-excel-97-a.html)

Lenn

Can't assign to Array .GetRows in Excel 97
 
Thank you in advance. Any help will be extremely appreciated; this project has to be turned in by tomorrow.

I developed a macro in Excel 2000. It uses ADO to connect to Access db. Before handing it in to the client I wanted to test this macro in office 97 (that's the version client is using). The following line of code generates compile error "Can't assign to array" :


arrCountries = oRSCountries.GetRows()

arrCountries is Dimmed as
Dim arrCountries() As Variant

The same code works under Excel 2000.
I have ADO 2.7 Reference check in both. What can be the problem? Any ideas?

Thanks


keepITcool

Can't assign to Array .GetRows in Excel 97
 
did you try ?

dim arrCountries as variant
(note it's NOT dimmed as an array)

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"?B?TGVubg==?=" wrote:

Thank you in advance. Any help will be extremely appreciated; this
project has to be turned in by tomorrow.

I developed a macro in Excel 2000. It uses ADO to connect to Access
db. Before handing it in to the client I wanted to test this macro in
office 97 (that's the version client is using). The following line of
code generates compile error "Can't assign to array" :


arrCountries = oRSCountries.GetRows()

arrCountries is Dimmed as
Dim arrCountries() As Variant

The same code works under Excel 2000.
I have ADO 2.7 Reference check in both. What can be the problem? Any
ideas?

Thanks




Lenn

Can't assign to Array .GetRows in Excel 97
 
It did it!!!! Thanks a lot KeepItCool, you are Cool!

"keepITcool" wrote:

did you try ?

dim arrCountries as variant
(note it's NOT dimmed as an array)

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"?B?TGVubg==?=" wrote:

Thank you in advance. Any help will be extremely appreciated; this
project has to be turned in by tomorrow.

I developed a macro in Excel 2000. It uses ADO to connect to Access
db. Before handing it in to the client I wanted to test this macro in
office 97 (that's the version client is using). The following line of
code generates compile error "Can't assign to array" :


arrCountries = oRSCountries.GetRows()

arrCountries is Dimmed as
Dim arrCountries() As Variant

The same code works under Excel 2000.
I have ADO 2.7 Reference check in both. What can be the problem? Any
ideas?

Thanks






All times are GMT +1. The time now is 12:35 PM.

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