Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 12th, 2009, 01:03 PM
Authorized User
 
Join Date: Jan 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Protecting Workbook - deleting hidden worksheets

I'm setting up a workbook and have some 2 major issues. I have 2 worksheets in the workbook that are hidden, and when a macro is run, it asks for a password, and then unhides the sheets. Only a few people will have access to this password. And the file is only located in one folder, and it's the only workbook, there are no copies.

#1 issue - I need to set up code that, if someone tries to do a "save as" to another folder, it needs to do a copy-paste values on any links that are in the workbook, between the worksheets, and delete the 2 hidden sheets from the workbook.

#2 issue - When someone opens the workbook, it needs to verify where the workbook is located. If it's not in the proper folder, it needs to run a macro that will copy-paste values on any links, and delete the hidden worksheets.

Can anyone help me with either one? I know what I want it to do, and I can kind of see the coding that needs to be done, but I do not have enough experience with coding to actually figure it out.

I would appreciate any help that I can get!
 
Old May 14th, 2009, 06:13 AM
Authorized User
 
Join Date: Jan 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can anyone point me in the right direction to start?
 
Old May 14th, 2009, 07:31 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

You can try using the following events

1.) Workbook_BeforeClose

2.) Workbook_Open

Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Protecting Folder itHighway Classic ASP Databases 1 December 16th, 2004 11:55 PM
Protecting Folder itHighway Classic ASP Components 0 December 15th, 2004 11:48 PM
Protecting Cells jacks Excel VBA 1 February 20th, 2004 11:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.