Is this a bug?

DHS100

Board Regular
Joined
May 21, 2006
Messages
149
Sorry for the lame title, but I'm confused.

I have a workbook with VBA. It ran fine on my machine but when I emailed it out, people got errors. I then downloaded the copy I sent out and also got the errors (no differences between the working copy and the email one, other than one was emailed). The line it breaks on can then IMMEDIATELY be F8'd through.

Things that might be important are:

* The code breaks after clicking "Enable" on "The file originated from an Internet location and might be unsafe. Click for more details"
* The line it breaks on gives "Method 'Worksheets' of object 'Global failed"
* Pressing debug and then F8 sometimes then works or sometimes gives "Can't move focus to the control because it is invisble, not enabled, or of a type that does not accept the focus".
* Pressing F8 again gives (sometimes) "Method 'Worksheets' of object 'Global failed"
* The line in question reads: If Worksheets("DATA").[A1].Value = vbNullString Then
* Also, that sheet was invisible but isn't now.

Any ideas? I tried renaming the worksheet and back again but no...
 
Last edited:

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Have you tried using Range instead of the [] shortcut?
Code:
If Worksheets("DATA").Range("A1").Value = vbNullString Then

You could also try changing vbNullString to "".
 
Upvote 0

Forum statistics

Threads
1,215,056
Messages
6,122,907
Members
449,096
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top