+ Reply to Thread
Results 1 to 3 of 3

Excel 2007 : code works (manually F8) but not with button

  1. #1
    Forum Contributor
    Join Date
    11-18-2008
    Location
    uk
    MS-Off Ver
    Excel 2003 and Excel 2010(sometimes)
    Posts
    139

    code works (manually F8) but not with button

    Hi

    this is a tough one

    hard to explain and the file contains alot of code can be confusing

    the code all works fine manually (using F8) and automatically using a button

    i am trying to unprotect the sheet("RawData") to transfer data in the sheet then protect it at the end of the code to prevent any changes

    it seems to work the first time after opening the file but then it doesnt work after that

    if anyone would like to work through the process please do so as follows

    Form opens on opening
    Select BS969
    Select Go & No Go
    Enter Go = 10
    Enter No Go = 11
    Select THV - FC132
    Select Metric

    the first time Sheet("RawData") will be protected but if you try it again pressing the button 'Open Form' the sheet is not protected

    why? i have no idea

    would appreciate any comments and suggestions on how to improve my code

    thanks in advance
    Attached Files Attached Files
    Last edited by Geordie; 05-04-2010 at 06:19 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: code works (manually F8) but not with button

    I confess I've not looked at this in detail so have no comments to make on the code itself - however - the most obvious culprit would be:

    Please Login or Register  to view this content.
    ie the code used to display the form the 2nd time - as I see it you don't need the unprotect line (this is seemingly handled in the UF code).

  3. #3
    Forum Contributor
    Join Date
    11-18-2008
    Location
    uk
    MS-Off Ver
    Excel 2003 and Excel 2010(sometimes)
    Posts
    139

    Re: code works (manually F8) but not with button

    Hi

    thanks for that, seems to work a treat now

    thanks again

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1