Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 93
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

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