[vba] ActiveCell in Online xls document

C

Cassy

Hi all,

I made a calculator for a client of mine in a MS Excel Workbook (Office2k)
so far so good ...

Now they want to put the MS Excel file online, as an intranet
application. But then the users get an error message saying:
"Run-time error '91' Object variable or With block variable not set"
on this line of code:
Code:
ActiveCell.Offset(1, 0).Select

Using the Range("A1").Select for example works, but I want to run over
50 cells containing parameters for the calculator.

I should be able to use it like this:
Code:
Dim i
For i=1 to 5
Range("A" & Cstr(i)).Select
Next 'i

But changing every ActiveCell in my code would be very difficult. Is
there another solution possible?

Thx in advance

-Cassy-
http://users.skynet.be/cassy
 
J

Jim Rech

ActiveCell is a window property. If no window is visible there is no active
cell. I'm guess that is the reason for the error message. If you cannot
address that then you may have to do some recoding.

Btw, it's usually not necessary to select cells to do something with them.

--
Jim Rech
Excel MVP
| Hi all,
|
| I made a calculator for a client of mine in a MS Excel Workbook (Office2k)
| so far so good ...
|
| Now they want to put the MS Excel file online, as an intranet
| application. But then the users get an error message saying:
| "Run-time error '91' Object variable or With block variable not set"
| on this line of code:
|
Code:
| ActiveCell.Offset(1, 0).Select
|
|
| Using the Range("A1").Select for example works, but I want to run over
| 50 cells containing parameters for the calculator.
|
| I should be able to use it like this:
|
Code:
| Dim i
| For i=1 to 5
| Range("A" & Cstr(i)).Select
| Next 'i
|
|
| But changing every ActiveCell in my code would be very difficult. Is
| there another solution possible?
|
| Thx in advance
|
| -Cassy-
| http://users.skynet.be/cassy
 

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

Top