+ Reply to Thread
Results 1 to 8 of 8

Num Lock gets off when opening the workbook

  1. #1
    Forum Contributor
    Join Date
    02-12-2013
    Location
    Brussel
    MS-Off Ver
    Excel 2013
    Posts
    134

    Num Lock gets off when opening the workbook

    Hi there!

    I've just added the following code to my workbook
    Please Login or Register  to view this content.
    and when I open it, the num lock turns off. Any idea why?
    Last edited by boboivan; 03-31-2014 at 08:53 AM.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Num Lock gets off when opening the workbook

    I added that to a blank workbook and tried and my numlock stays on - I'd suggest uploading an example workbook which demostrates the behaviour to check it isn't something else other than that code?

    Edit: looking at google, it seems executing multiple sendkeys statements can turn numlock off (as a bug) - what is the macro supposed to do - maybe is there a way to do it without sendkeys?
    Last edited by ragulduy; 03-31-2014 at 08:56 AM.

  3. #3
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Num Lock gets off when opening the workbook

    I've seen send keys do this before.

    Try commenting out
    Please Login or Register  to view this content.
    saving and then re-opening.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  4. #4
    Forum Contributor
    Join Date
    02-12-2013
    Location
    Brussel
    MS-Off Ver
    Excel 2013
    Posts
    134

    Re: Num Lock gets off when opening the workbook

    Quote Originally Posted by Solus Rankin View Post
    I've seen send keys do this before.

    Try commenting out
    Please Login or Register  to view this content.
    saving and then re-opening.

    I didn't get it Solus !
    What should I do here?

    Edit:
    I got it!
    I've made a comment in the line, I've saved it, reopend it, and still turns off the Num Lock.
    Last edited by boboivan; 03-31-2014 at 09:14 AM.

  5. #5
    Forum Contributor
    Join Date
    02-12-2013
    Location
    Brussel
    MS-Off Ver
    Excel 2013
    Posts
    134

    Re: Num Lock gets off when opening the workbook

    Quote Originally Posted by ragulduy View Post
    I added that to a blank workbook and tried and my numlock stays on - I'd suggest uploading an example workbook which demostrates the behaviour to check it isn't something else other than that code?

    Edit: looking at google, it seems executing multiple sendkeys statements can turn numlock off (as a bug) - what is the macro supposed to do - maybe is there a way to do it without sendkeys?
    The macro should automatically open the drop down lists in columns 2,5,10,11,19,30,34

  6. #6
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Num Lock gets off when opening the workbook

    You could try turning numlock back on using API like this:
    Please Login or Register  to view this content.

  7. #7
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Num Lock gets off when opening the workbook

    I am not a big fan of Sendkeys(). Even so, sometimes it will have to do.

    I had thought of using API routine to check and set the numlock key status as well.

    Here is an API method for a sendkeys sort of method. The advantage is that UAC status does not affect this method.

    Please Login or Register  to view this content.
    Put this in a Module.
    Please Login or Register  to view this content.
    For kicks, here two methods that I use for toggle keys like numlock.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by Kenneth Hobson; 03-31-2014 at 12:26 PM.

  8. #8
    Forum Contributor
    Join Date
    02-12-2013
    Location
    Brussel
    MS-Off Ver
    Excel 2013
    Posts
    134

    Re: Num Lock gets off when opening the workbook

    Thank you so much Kenneth!
    Problem solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copy data one workbook to another workbook without opening workbook
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-04-2014, 11:28 AM
  2. [SOLVED] Stop an excel workbook or worksheet from opening if workbook isn't in a certain folder
    By Raulus in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-05-2013, 05:30 AM
  3. Opening Excel Application before Opening Workbook
    By danny2000 in forum Access Tables & Databases
    Replies: 2
    Last Post: 05-27-2011, 07:02 AM
  4. [SOLVED] Lock up when opening files in Excel
    By Mike in the UK in forum Excel General
    Replies: 1
    Last Post: 04-15-2006, 08:40 AM
  5. [SOLVED] How do I deny opening and viewing any file to any user and lock i.
    By Leah Wright in forum Excel General
    Replies: 1
    Last Post: 04-22-2005, 07:06 PM

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