ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Method 'Rows' Of Object '_Global Failed (https://www.excelbanter.com/excel-programming/385369-method-rows-object-_global-failed.html)

[email protected]

Method 'Rows' Of Object '_Global Failed
 
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


Dave Peterson

Method 'Rows' Of Object '_Global Failed
 
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

wrote:

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


--

Dave Peterson


All times are GMT +1. The time now is 05:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com