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 August 5th, 2004, 12:53 PM
Registered User
 
Join Date: Aug 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Excel "Protection" prohibiting macros running

I have built macros which hide and display certain rows depending on which objectbutton a user clicks. When I protect the worksheet (and I've tried setting various privileges) and click on the appropriate objectbutton, the macros fail stating that the worksheet has to be unprotected to run them. It seems to fail on the code:

Selection.EntireRow.Hidden = False

Any ideas on how to solve this issue?
 
Old August 5th, 2004, 11:26 PM
Authorized User
 
Join Date: Feb 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi
In your buttons event procedure you can do the following.

eg.
Private Sub CommandButton1_Click()
   Sheet1.Unprotect
   'do what you ned to do
   Sheet1.Protect
End Sub

Cheers
Karsten







Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel macros [email protected] Excel VBA 1 August 29th, 2007 10:50 PM
How to Run Excel Macros from ASP asptest Classic ASP Databases 7 September 13th, 2006 10:47 AM
Excel Macros with VBA kotaiah Excel VBA 1 September 11th, 2006 01:39 AM
How to get a list of macros in an Excel sheet tiyyob Excel VBA 0 January 21st, 2006 06:59 PM
Running Excel VBA Macros shattered Visual Basic 2005 Basics 0 November 14th, 2005 06:07 AM





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