Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default run time error 32809

I am running Excel 2010/Windows 7 on a large network. I've recently updated an application that was originally written 4+ years ago and has been enhanced throughout the years. The latest version works fine on my machine, but some users are getting the following error upon opening the macro:

Run-time error '32809'
Application-defined or object-defined error

The trigger is the following code in sheet 'ThisWorkbook'

Private Sub Workbook_Open()
Application.ScreenUpdating = False
Sheets("Instructions").Activate
Application.ScreenUpdating = True
End Sub

The error is pointing to the "Instructions" sheet (in this case it is also Sheet33

Any suggestions as to why this is happening?

Art
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default run time error 32809

Claus,

No leading or trailing spaces, sheet is visible.

I did change the first line to

Private Sub Auto_Open

and the issue apparently went away. However, I'd really like to understand why this happened.

Art

On Tuesday, March 3, 2015 at 10:11:17 AM UTC-5, wrote:
I am running Excel 2010/Windows 7 on a large network. I've recently updated an application that was originally written 4+ years ago and has been enhanced throughout the years. The latest version works fine on my machine, but some users are getting the following error upon opening the macro:

Run-time error '32809'
Application-defined or object-defined error

The trigger is the following code in sheet 'ThisWorkbook'

Private Sub Workbook_Open()
Application.ScreenUpdating = False
Sheets("Instructions").Activate
Application.ScreenUpdating = True
End Sub

The error is pointing to the "Instructions" sheet (in this case it is also Sheet33

Any suggestions as to why this is happening?

Art


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default run time error 32809

I'm going to suggest you *do not use* the Workbook_Open event at all,
*ever*. Instead, in a standard module...

Option Explicit
Option Private Module

Sub Auto_Open()
Application.GoTo ThisWorkbook.Sheets("Instructions").Range("A1")
End Sub

...where this is a 'public' scope procedure exclusive to your project.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default run time error 32809

Ok, I'll bite. Why not use the auto_open or workbook_open events?

Art


On Tuesday, March 3, 2015 at 2:50:29 PM UTC-5, GS wrote:
I'm going to suggest you *do not use* the Workbook_Open event at all,
*ever*. Instead, in a standard module...

Option Explicit
Option Private Module

Sub Auto_Open()
Application.GoTo ThisWorkbook.Sheets("Instructions").Range("A1")
End Sub

..where this is a 'public' scope procedure exclusive to your project.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default run time error 32809

Ok, I'll bite. Why not use the auto_open or workbook_open events?

Use Auto_Open procedure *instead* of Workbook_Open event is what I
suggested. Auto_Open (and Auto_Close) are AutoMacros that will run
independant of events. So if for any reason events are disabled when
your file is opened (or closed), your AutoMacros will run.

Also, if your project becomes corrupt the events for ThisWorkbook may
not even work!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time error 57121 & 32809, Excel 2003 SP2 Adrian C[_2_] Excel Programming 2 July 25th 12 12:43 PM
Runtime Error 32809 Lance Roberts Excel Programming 3 March 9th 09 06:52 PM
Error handling error # 1004 Run-time error [email protected] Excel Programming 3 May 20th 08 02:23 PM
unexpected error (32809) Student Excel Programming 7 February 6th 07 07:24 PM
Errors 32809 and 57121 :-( Jan[_18_] Excel Programming 0 June 3rd 06 05:56 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"