Solved

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

Posted on 2016-09-18
5
31 Views
Last Modified: 2016-09-19
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
Comment
Question by:Gustav Brock
  • 2
  • 2
5 Comments
 
LVL 18
ID: 41804344
I like to change that one too, gustav ;) ~

Set Visual Basic Environment Options
https://msdn.microsoft.com/en-us/library/office/gg264737.aspx
0
 
LVL 13

Accepted Solution

by:
John Tsioumpris earned 500 total points
ID: 41804373
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
 
LVL 49

Author Closing Comment

by:Gustav Brock
ID: 41804399
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
 
LVL 13

Expert Comment

by:John Tsioumpris
ID: 41804400
Good observations Gustav....i found it by searching through ProcMon
0
 
LVL 18
ID: 41804403
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now