Method 'Rows' Of Object '_Global Failed

S

seamus.feeney

Hi i've never posted here and dont know a huge amount of VB but would
appreciate any help you can give me.

I have a spread sheet set up with a userform that when the user hits
the ENTER button this macro puts the data in a worksheet.

It works fine in excel no problems. However i've noticed when the
complete workbook is open Internet Explorer the enter button gets this
error

Method 'Rows' Of Object '_Global Failed

The code behind the button is

Private Sub CommandButton3_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Sheet2

'find first empty row in database
iRow = ws.Cells(Rows.Count, 2) _
.End(xlUp).Offset(1, 0).Row

and debugging suggests that this is the problem =
ws.Cells(Rows.Count, 2) _

any suggestions, its not very important just strange that this is the
only macro in a workbook of hundreds that doesnt work when open in
Explorer
 
D

Dave Peterson

I think that there are lots of things that don't work in MSIE.

I'd do my best to not let MSIE open the file:

How to Configure Internet Explorer to Open Office
Documents in the Appropriate Office Program Instead of in Internet Explorer
http://support.microsoft.com/?scid=162059

====
But a completely untested, uninformed guess...

How about qualifying that rows.count:

iRow = ws.Cells(ws.Rows.Count, 2) _
.End(xlUp).Offset(1, 0).Row
 

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