View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
David David is offline
external usenet poster
 
Posts: 1,560
Default Error with Auto Open Macro

So how can I write a macro that will take me to sheet 1, cell A1 of any
workbook I open? Where should I save it?

"Tom Ogilvy" wrote:

Since Personal.xls is hidden, you should not try to select and activate in
that workbook.

--
Regards,
Tom Ogilvy

"David" wrote in message
...
I have created a simple macro named Auto_Open and saved in in

Personal.XLS. I
want the macro to start automatically and go to sheet 1, cell A1. Here is

the
macro:

Sub Auto_Open()
Sheets(1).Activate
Range("A1").Activate
End Sub

But when I start excel trying to open a file, I get an error before the
worksheet even comes up. It is a run-time error 1004, Method 'Sheets' of
object '_Global' failed. What am I doing wrong?