Solved

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

Posted on 2016-09-18
5
46 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 19
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 15

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 15

Expert Comment

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

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sum in Split Form 17 28
set focus to tabbed sub form 10 39
Currency field that has too many digits after the decimal point. 16 52
Signature required on a report 5 35
In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

821 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