Questions tagged [vbe]

Visual Basic Editor is the built in IDE for writing VBA. It is hosted by various MS Office programs. Use this tag for general questions about the IDE or the Microsoft VBA Extensibility Library (VBIDE) which allows automation of the Visual Basic for Applications Editor.

Visual Basic Editor is the built in IDE for writing VBA. It is hosted by various MS Office programs. Use this tag for general questions about the IDE or the Microsoft VBA Extensibility Library (VBIDE) which allows automation of the Visual Basic for Applications Editor.

VBE has three key elements: Code window (on the right); Projects window (top left), and Properties window (bottom left). Example for Excel:

VBE example

Others may be added, for example for Watches.

217 questions
2
votes
0 answers

When recording in Excel 2016 there are lines in red with just a "." on the left of the equal sign

When I record macros the code does not work and there are several lines highlighted in red which have just a "." on the left side of the equal sign. It appears to me that the macro is doing something along the lines of just registering my changes…
Jay Haran
  • 123
  • 1
  • 9
2
votes
1 answer

Setting shortcut values in VBE using CTRL key

As you may know, in the VBE if you right click on the tool bar and select customize, then right click on a tool bar button you can add an ampersand (&) in front of a letter to create a shortcut using the ALT key. Is it possible to set a shortcut…
pheeper
  • 1,457
  • 4
  • 20
  • 37
2
votes
1 answer

replace text in code module

Im trying to use the replaceline function to update code in Access VBA module. it keeps coming up with a compile error. Ive checked that the VBA Extension are selected and compared it to other examples that I have looked up. this is the first time…
Ian Cox
  • 85
  • 3
  • 12
2
votes
1 answer

Using other workbook macros: Tools - References in VBA

I'm using another workbook as a library of common routines (Tools - References - etc). It works just fine. However, when the caller file loads it as a reference it also opens the library file on the background. Two questions: Is it possible to make…
hardish
  • 145
  • 2
  • 11
2
votes
2 answers

How can I iterate the controls on a MS-Access form?

I have a method where, given a VBComponent, I can access the .Designer and from there, the .Controls collection: private void DeclareControlsAsMembers(VBComponent form) { var designer = form.Designer; if (designer == null) { …
Mathieu Guindon
  • 69,817
  • 8
  • 107
  • 235
2
votes
1 answer

How to incorporate a changing variable into a text Msgbox in VBA?

I am currently trying to make a simple VBA program that would multiply two numbers together and then prompt a message box that says "The value of (variable1) and (variable 2) is (The answer). Here is my current attempt that isn't perfect: MsgBox…
Zack Withrow
  • 125
  • 1
  • 2
  • 11
2
votes
2 answers

Is there VBA syntax highlighting for opening and closing loops and if statements?

Sorry if this has been asked before but I can't seem to find any information on this. I am working with VBA for automating word documents and I have this huge block of code with tons of "if else" statements, "do while" loops and "with" statements…
Kurt Leadley
  • 513
  • 3
  • 20
2
votes
1 answer

vba module.find with line breaks (Ms access 2013)

I have been using a piece of code to find specific text within vba modules. It works well for finding a single line (or less) of text. So, for example it will find 'mySub' in a module with text : Private sub mySub() Dim a as Integer Dim b as…
Esby
  • 105
  • 1
  • 15
2
votes
1 answer

How to automate find/replace code in VBA modules in MS Office 2013?

I have a large number of Excel Templates that contain VBA code that need to be updated. The Find method of the code-module object only returns true/false, not the location of the found string. Is there…
JHSEYMOUR
  • 53
  • 1
  • 7
2
votes
4 answers

Worksheet names in VBE

I've noticed that my workbook has two different names for each component in the VBE. What is the difference between name1 and name2? Which one should I refer to, so I will be sure my macro will work?
Ihidan
  • 558
  • 1
  • 7
  • 25
2
votes
2 answers

Can VBE be invoked/used OUTSIDE of an Office Application?

This may be a silly question - I haven't found anything on Google about this. No new programs populate in the task manager when VBE is opened from an Office Application, and I don't see an executable that looks probable. DLL maybe?
David Mancini
  • 428
  • 7
  • 20
2
votes
0 answers

Can a window be opened as vbModeless?

I am using the following code to automate the command bar to unprotect VBE in a locked workbook: Application.VBE.CommandBars(1).FindControl(ID:=2578, recursive:=True).Execute Next, I add the password to this window using a bunch of code after this…
Examorph
  • 143
  • 1
  • 1
  • 7
2
votes
2 answers

grub2, grub-mkrescue, bios, vbe framebuffer, custom kernel

Time to ask my first-ever question here. At some point in past, I used to have my kernel Just Work (TM) with GRUB2; it still does with GRUB Legacy, but I want [VBE] framebuffer graphics. The first problem I noticed is that grub-mkrescue -o cd.iso…
Vendu
  • 39
  • 1
  • 3
2
votes
1 answer

Write code into VBA IDE from .NET

I'm looking for a way to write code from a VB.NET add-in into a VBA project So say write "Msgbox("Hello world!")" into a .bas module as part of an Excel project from .NET so the code written from .NET would be some pre written VBA stored as a string…
spences10
  • 570
  • 1
  • 13
  • 32
2
votes
1 answer

Programmatically unprotect MS Excel VBA project in Windows 8

I'm having some trouble unprotecting a workbook's VBA project via code. The SendKeys method used to work pretty well, but in Windows 8 64-bit it doesn't work anymore. What could be the reason? Does someone know a different method for this…
blitziken
  • 61
  • 1
  • 1
  • 8