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

Gustav Brock gustav at cactus.dk
Mon Sep 19 03:16:01 CDT 2016


Hi Charlotte et al

John Tsioumpris at Experts Exchange found it for me. It's a registry setting:

    [HKEY_CURRENT_USER\Software\Microsoft\VBA\6.0\Common]

Two things to add:

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

However, and strangely, property VBE.Version 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

-----Oprindelig meddelelse-----
Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] På vegne af Gustav Brock
Sendt: 19. september 2016 08:01
Til: Access Developers discussion and problem solving <accessd at databaseadvisors.com>
Emne: Re: [AccessD] Read the "Options, Tab Width" setting of the the VBE Options from VBA?

Thanks Charlotte, but that covers commandbars and so on. 

I just need reading the Tab Width setting. Perhaps it is hidden somewhere else.

/gustav

-----Oprindelig meddelelse-----
Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] På vegne af Charlotte Foust
Sendt: 18. september 2016 23:10
Til: Access Developers discussion and problem solving <accessd at databaseadvisors.com>
Emne: Re: [AccessD] Read the "Options, Tab Width" setting of the the VBE Options from VBA?

Here's a link to some code manipulating the environment.  It's aimed more toward Excel, but should translate.

http://www.cpearson.com/excel/vbemenus.aspx

Charlotte Foust
(916) 206-4336

On Sun, Sep 18, 2016 at 1:01 PM, Gustav Brock <gustav at cactus.dk> wrote:

> Hi Charlotte
>
> It's the setting Tools, Options, Editor, Tab Width I wish to read. 
> Default value is 4.
>
> /gustav 



More information about the AccessD mailing list