• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 88
  • Last Modified:

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:
VBE
My guess was that it could be found somewhere under the VBE object, but that seems not to be the case.

/gustav
0
Gustav Brock
Asked:
Gustav Brock
  • 2
  • 2
1 Solution
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
I like to change that one too, gustav ;) ~

Set Visual Basic Environment Options
https://msdn.microsoft.com/en-us/library/office/gg264737.aspx
0
 
John TsioumprisSoftware & Systems EngineerCommented:
I don't think you can access this setting under VBA.
There is a setting set in registry
[HKEY_CURRENT_USER\Software\Microsoft\VBA\6.0\Common]
You will see a TabWidth which you can modify
0
 
Gustav BrockCIOAuthor Commented:
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
0
 
John TsioumprisSoftware & Systems EngineerCommented:
Good observations Gustav....i found it by searching through ProcMon
0
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
here is a link for setting it using visual studio -- called tab size
https://msdn.microsoft.com/en-us/library/awdwz11a.aspx
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now