Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Brian Hearty via OfficeKB.com
 
Posts: n/a
Default Open Workbook At A Set Page

There is a web site called www.officearticles.com that explains some good
tips on using excel. However, I am having difficulties getting one of the
tips to work.
To ensure that a workbook is opened at a specific page regardless of where
the last user was within the book when he/she saved and closed it the
following piece of VB code is suggested:

While in Visual Basic Editor, double-click ThisWorkbook and enter the
following code:
Private Sub Workbook_Open()
Range("Sheet1!A1").Activate
End Sub

Unfortunately I get a run time error each time I attempt to run it - is there
something extra that needs to be included in the code in order for it to run
correctly?


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200511/1
  #2   Report Post  
Roger Govier
 
Posts: n/a
Default Open Workbook At A Set Page

Hi Brian

Do you have a Sheet1?
If not change code to include your sheet name.

Regards

Roger Govier


Brian Hearty via OfficeKB.com wrote:
There is a web site called www.officearticles.com that explains some good
tips on using excel. However, I am having difficulties getting one of the
tips to work.
To ensure that a workbook is opened at a specific page regardless of where
the last user was within the book when he/she saved and closed it the
following piece of VB code is suggested:

While in Visual Basic Editor, double-click ThisWorkbook and enter the
following code:
Private Sub Workbook_Open()
Range("Sheet1!A1").Activate
End Sub

Unfortunately I get a run time error each time I attempt to run it - is there
something extra that needs to be included in the code in order for it to run
correctly?


  #3   Report Post  
Brian Hearty via OfficeKB.com
 
Posts: n/a
Default Open Workbook At A Set Page

Hi Roger

Thanks for the response. Yes I've tried Sheet1 and an actual sheet name but
no success either way.

Brian


Roger Govier wrote:
Hi Brian

Do you have a Sheet1?
If not change code to include your sheet name.

Regards

Roger Govier

There is a web site called www.officearticles.com that explains some good
tips on using excel. However, I am having difficulties getting one of the

[quoted text clipped - 12 lines]
something extra that needs to be included in the code in order for it to run
correctly?



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200511/1
  #4   Report Post  
dominicb
 
Posts: n/a
Default Open Workbook At A Set Page


Good morning Brian Hearty

The code seems sound enough, and from your description, you are
certainly pasting it to the right place. But do you have a sheet named
"Sheet1"...?

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=480795

  #5   Report Post  
 
Posts: n/a
Default Open Workbook At A Set Page

Try this instead

Private Sub Workbook_Open()

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

End Sub



  #6   Report Post  
Brian Hearty via OfficeKB.com
 
Posts: n/a
Default Open Workbook At A Set Page

Top Man!
Thanks for all the responses on this, the last one from stringstroker62 works
a dream.

Thanks
Brian

wrote:
Try this instead

Private Sub Workbook_Open()

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

End Sub



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200511/1
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
Calc status of open excel workbook should not overwrite another Michael Hill Setting up and Configuration of Excel 1 October 28th 05 06:48 PM
Open excel from htm page den Excel Discussion (Misc queries) 0 April 25th 05 11:58 PM
How do I open my excel workbook? ajojoel Excel Discussion (Misc queries) 5 April 21st 05 07:41 AM
Stubborn toolbars in Excel 007 Excel Discussion (Misc queries) 9 December 11th 04 02:02 PM
Can no open workbook tandem Excel Worksheet Functions 4 December 1st 04 12:45 AM


All times are GMT +1. The time now is 02:25 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"