Excel macro error when opened in internet browser

  • Thread starter Thread starter alec
  • Start date Start date
A

alec

I have an excel file which users access via the internet.
The users seem to want to open the file in a browser
rather than download the file and open in Excel. The
problem is that the macros do not work when the file is
opened from inside the internet explorer browser.

The following line gives an error:

N = Application.WorksheetFunction.CountA(ActiveSheet.Range
("B:B"))

The error is:
"Run-time error '91':
Object variable or With block variable not set"

I wrote the macro in Excel 2000.
Any help is appreciated.
 
Hello Alec

Try setting the Worksheet in question to be the ActiveWorksheet. Do this

NameOfWorksheet.Activat

then call your WorksheetFunctio

Your Worksheet name may be an Object or ThisWorkbook.Worksheets("NameOfWorksheet"

Dee
 

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

Back
Top