Link to home
Start Free TrialLog in
Avatar of Gustav Brock
Gustav BrockFlag for Denmark

asked on

Read the "Options, Tab Width" setting of the the VBE Options from VBA?

How to read this, please?

It's at the menu: Tools, Options, Editor, Tab Width. This setting I wish to read. Default value is 4:
User generated image
My guess was that it could be found somewhere under the VBE object, but that seems not to be the case.

/gustav
Avatar of crystal (strive4peace) - Microsoft MVP, Access
crystal (strive4peace) - Microsoft MVP, Access

I like to change that one too, gustav ;) ~

Set Visual Basic Environment Options
https://msdn.microsoft.com/en-us/library/office/gg264737.aspx
ASKER CERTIFIED SOLUTION
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gustav Brock

ASKER

Thanks John, that's it. (Crystal, that link is for the UI only).

Two things to add:

[list]This registry entry does not exist by default. It is created first time you change the setting.[/list]
[list]For Access 2016, the path is: ..\VBA\7.1\Common[/list]

However, and strangely, property [b]VBE.Version[/b] reports 7.01, not 7.1 so you have to find the path perhaps like this:

    VbeVersion = Replace(VBE.Version, "0", "")

or, though doubtful, in case of an upcoming version 10:

    VbeVersion = Split(VBE.Version, ".")(0) & "." & CStr(Val(Split(VBE.Version, ".")(1)))

/gustav
Good observations Gustav....i found it by searching through ProcMon
here is a link for setting it using visual studio -- called tab size
https://msdn.microsoft.com/en-us/library/awdwz11a.aspx