error message

G

Guest

Hi,

I get the error message "Variable uses an Automation type not supported in
visual basic"

For i = 1 To (100 - IAGE)
x=xt(i)
Next i

But this type of logic has worked before.

Do I need to declare the variable i.

IAGE is declared as a double.

Excel 97

Thanks for your help.
 
G

Guest

You don't HAVE to declare variables before use unless you see
Option Explicit
at the top of the module - that requires all to be declared before use.

What is the value of IAGE? If it is larger than 100, then the result of
(100-IAGE) will be negative and that could be a problem. To count in
reverse, as from 1 to a negative number use:
For i = 1 to (100 - IAGE) Step -1

of course then there's the question of whether or not your xt(i) array has
negative array elements in it.

As to the need to declare variables - I always do, and recommend it to
anyone - easy way to keep typos and type mismatches from eating your shorts
at run time.
 

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

VBA - get result from 1
[public variables - problem] 1
Data 1
Declare variables to a code? 6
VBA - Function Output 2
Using a for loop 1
Overflow error when declaring variables 2
type declaration characters 3

Top