+ Reply to Thread
Results 1 to 3 of 3

Changing the "Macros in" default setting

  1. #1
    Forum Contributor
    Join Date
    08-04-2005
    Location
    Madrid, Spain
    MS-Off Ver
    2010
    Posts
    241

    Changing the "Macros in" default setting

    To the attention of Ron Coderre, if possible:
    Ron, you just helped me change the screen viewing zoom, by means of a macro the core instruction of which is “ActiveWindow.Zoom”:
    Please Login or Register  to view this content.
    I wonder if there is something similar for this other default setting: the “Mcros in:” field in the macro dialogue box.
    In my Excel 2002, the default option in this field is “All workbooks open” and I would like to change it to “This workbook”. Is there any code equivalent to "If ActiveWindow.Macros In = All workbooks, then ActiveWindow.Macros In = This workbook..."?

    Thank you for any new help.
    ACA

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Changing the "Macros in" default setting

    Hi Aca,

    Not sure this is a setting that can be adjusted or accessed via code. One option that comes to mind is using SendKeys, like so:
    Please Login or Register  to view this content.
    This could be linked to a button or key combination. It sends ALT+F8 to open the Macros dialog, then sends two TABs to get to the Macros In field, and finally types the letter T and then Enter so that "This Workbook" is selected.

    Hopefully that can work for you.

  3. #3
    Forum Contributor
    Join Date
    08-04-2005
    Location
    Madrid, Spain
    MS-Off Ver
    2010
    Posts
    241

    Re: Changing the "Macros in" default setting

    Thank you for this, Paul. I sense that your advice points to a possible solution; as it is, however, it doesn’t actually work; perhaps you can see where the glitch lies:

    I create the macro, and locate it in This WorkBook.
    But when executing it, already in its first step, the command, Application.SendKeys "%{F8}" -(just "{F8}" seems to work equally well) - opens a macro dialogue box which is not the right one: not the one that opens when I actually press ALT+F8, with different options for the “Macros In:” field, (and one more button on the right).

    Please see this in the attached screenshots: The file “test1” is the one produced by the macro; while “test2” is the one I get when pressing ALT+F8, the one expected, the right one - (the language of my Excel is Spanish, sorry).
    Attached Images Attached Images

+ 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