Version Compatibility Issue

R

Ripan

I have written the following function on Excel 2002 and it works withou
error on my computer. However, on a client machine, there is an error
"Compile Error: Variable not Defined" with the first line of this cod
highlighted. The client is running Office 2000 with Excel 2000.
believe this is a version compatibility issue but as I do not have
way of testing my code out on an Excel 2000 machine, is there any wa
to isolate what line in the following function is the culprit?

Any help is appreciated.



Function CreateDataArray() As Variant
'This function puts the relevant data elements and their names into
2-dimensional array, which is used
'by the DecisionTree module to score the segment

Dim data() As Variant

ReDim data(Range("Data_Fields").Rows.Count, 2) As Variant

'fill names of data fields
For i = 0 To Range("Data_Fields").Rows.Count - 1
data(i, 0) = Range("Data_Fields").Rows(i + 1, 0).value
Next i

'fill values of data fields, this may need to be changed manually i
the scoring algorithm changes
data(0, 1) = OptionButtonValue(2) 'Importance of Price Vs. Headach
Free Plan
data(1, 1) = OptionButtonValue(1) 'Importance of Price Vs. Networ
Breadth and Quality
data(2, 1) = cbxIndustry.ListIndex 'Industry
data(3, 1) = cbxBenchmark.value 'Interest in Benchmarks
data(4, 1) = cbxInnovation.value 'Interest in Innovation
data(5, 1) = cbxPlanDesign.value 'Interest in Plan Design
data(6, 1) = cbxService.value 'Interest in Proactive Service
data(7, 1) = cbxSize.ListIndex 'Number of MA Eligibles
data(8, 1) = FormMethods.ListBoxToInteger(lstProducts)
data(9, 1) = cbxReports.ListIndex

CreateDataArray = data
End Functio
 
J

Jim Rech

If the user has Option Explicit set in his module and you haven't declared
all your variables (like i) then you might see this error.

--
Jim Rech
Excel MVP

|I have written the following function on Excel 2002 and it works without
| error on my computer. However, on a client machine, there is an error,
| "Compile Error: Variable not Defined" with the first line of this code
| highlighted. The client is running Office 2000 with Excel 2000. I
| believe this is a version compatibility issue but as I do not have a
| way of testing my code out on an Excel 2000 machine, is there any way
| to isolate what line in the following function is the culprit?
|
| Any help is appreciated.
|
|
|
| Function CreateDataArray() As Variant
| 'This function puts the relevant data elements and their names into a
| 2-dimensional array, which is used
| 'by the DecisionTree module to score the segment
|
| Dim data() As Variant
|
| ReDim data(Range("Data_Fields").Rows.Count, 2) As Variant
|
| 'fill names of data fields
| For i = 0 To Range("Data_Fields").Rows.Count - 1
| data(i, 0) = Range("Data_Fields").Rows(i + 1, 0).value
| Next i
|
| 'fill values of data fields, this may need to be changed manually if
| the scoring algorithm changes
| data(0, 1) = OptionButtonValue(2) 'Importance of Price Vs. Headache
| Free Plan
| data(1, 1) = OptionButtonValue(1) 'Importance of Price Vs. Network
| Breadth and Quality
| data(2, 1) = cbxIndustry.ListIndex 'Industry
| data(3, 1) = cbxBenchmark.value 'Interest in Benchmarks
| data(4, 1) = cbxInnovation.value 'Interest in Innovation
| data(5, 1) = cbxPlanDesign.value 'Interest in Plan Design
| data(6, 1) = cbxService.value 'Interest in Proactive Service
| data(7, 1) = cbxSize.ListIndex 'Number of MA Eligibles
| data(8, 1) = FormMethods.ListBoxToInteger(lstProducts)
| data(9, 1) = cbxReports.ListIndex
|
| CreateDataArray = data
| End Function
|
|
| ---
| Message posted
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top