Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-Time Error 1004 - Version Problem?

Status
Not open for further replies.

SpaaamCatcher

Technical User
Aug 21, 2003
19
US
I have created a fairly complex spreadsheet, but one of the most simple pieces of it is failing at the client machines. The whole thing works perfectly on my machines (office 2K or XP), but I'm not equipped for regression testing and the machines having a problem are 97.

An example of the line of code that's failing is:

Application.Goto Reference:=Worksheets("Sheet1").Range("A1")

The error this generates is:

Run-time error 1004: Method 'goto' of object _application failed.

This all works perfectly for me, but does not work for my folks, who are on 97 - is there different syntax for the prior versions?

This is just too simple to be such a showstopper...

Help ;-)
 
Hi SpaaamCatcher,

Can't see anything obvious and I just tried it on '97 and the syntax is the same and it works for me, so it's not as simple as you might like it to be. Sorry not to be more help at the moment.

Enjoy,
Tony
 
Can you replace the goto code with activate code?
e.g.
worksheets("sheet1").activate
range("A1").activate

Takes one line extra code, but it's more commonly used Excel VBA code, so maybe less likely to be version-dependent.

Rob
[flowerface]
 
HELP! This is too simple to drive me crazy ;-) The 'Activate' statement seemed like it would be perfect, so I tested it out in a clean workbook and it worked fine. Take the same code and paste it into my workbook and it fails! WHY would such a simple statement (see below) result in a run-time error? Is there some reference missing or something?

Worksheets("sheet1").Activate
Range("A1").Activate

The above simple code results in a 'application-defined or object-defined' error, failing on the range.activate line.

Is there something simple I'm missing or is this a crazy mystery??

jem
 
It is being called by another sub, which is initiated by a form button. But - if I just run it from within VBA, it still fails, so I suspect it's not related to how it's being called. Any chance there's something corrupt in the template?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top