+ Reply to Thread
Results 1 to 3 of 3

onkey action error

  1. #1
    Registered User
    Join Date
    10-11-2012
    Location
    Bromley
    MS-Off Ver
    Excel 2003; 2010
    Posts
    2

    Question onkey action error

    Hi,

    I set onkey in a worksheet.activate procedure;

    application.onkey "{F2}", "Edit_Cell"

    The onkey is removed under the worksheet.deactivate.

    The procedure "Edit_Cell" is in the same workbook and works correctly. (Allows a user to edit a cell in a protected sheet, without losing the contents)

    When the users presses 'F2' in the worksheet, excel tries to re-open the workbook and doesnt just call the procedure.

    Is there any reason excel would attempt to find the procedure in another copy of the same workbook?

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: onkey action error

    Ive just ran it on mine and it works fine. can you attach?
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    10-11-2012
    Location
    Bromley
    MS-Off Ver
    Excel 2003; 2010
    Posts
    2

    Re: onkey action error

    Hi, Thank you for the quick response. Unfortunately the file is commercially sensitive so I cant send in a completed form. I might be able to strip out the single element.

    I have used the onkey command many times, in many excel tools that I have developed, but I have not seen excel do this before!! The work computers have recently been upgraded to Win7 and Bit locker, which does from time to time have strange affects.

    Is there any common or known reason, for the behaviour, where excel tries to call the function in a new copy of the same file?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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