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
3
votes
0 answers

How can I pre-emptively determine if accessing a property will cause an AccessViolation?

I have a method in Rubberduck (an in-process VBE add-in) that is assigning a Picture and Mask to a CommandBarControl(Button). It works well when adding images to the VBE's of Excel, Word, etc., but it fails with an Access Violation when adding…
ThunderFrame
  • 9,352
  • 2
  • 29
  • 60
3
votes
1 answer

Open multiple VBE windows (one per projects) - Word VBA

I have a couple of projects in VBA which does stuff in Word. The thing is, currently all the projects that I open are in the same window of VBE. I would like to open more than one window of VBE in a way that there would be one VBE window for each…
Marks
  • 165
  • 4
  • 19
3
votes
1 answer

How to enable Unicode in Excel 2016 VBA editor

I have a worksheet with Hebrew word "שלום" in cell A1. I am trying to run this VBA code: Sub test() Dim str As String str = Range("A1") MsgBox str End Sub The message box displays: ???? Also, when I try to write Hebrew characters in…
Max Segal
  • 1,955
  • 1
  • 24
  • 53
3
votes
1 answer

OLE Automation and interacting with another VBE / VBA IDE

I am familiar with OLE Automation and controlling other applications from a given VBA IDE / VBE (particularly Excel's VBE). While I know it's possible to use the SendKeys method as a way to essentially accomplish what I am trying to do, I feel it…
Singularity20XX
  • 321
  • 5
  • 20
3
votes
3 answers

VBA debugger shows only 256 elements of a collection

I'm working on an Excel macro. Is there an option that the debugger shows all elements like it does with an array? If not, is the only workaround the storage of my classobjects in an array after inflating the collection?
Maik3141
  • 33
  • 1
  • 6
3
votes
1 answer

Unable to cast COM object to Microsoft.Vbe.Interop.VBE

I have a COM add-in written in C#, that works perfectly fine with Microsoft Office. There was a GitHub issue asking if the add-in supported the VB6 IDE; is there anything different I need to do, to make it work with Visual Studio 6.0? Here's the…
Mathieu Guindon
  • 69,817
  • 8
  • 107
  • 235
3
votes
1 answer

Userform design time: Move controls with arrowkeys

Is there any way to arrange the controls in the userform using only arrowkeys (not dragging) ?
Roger Barreto
  • 2,004
  • 1
  • 17
  • 21
3
votes
1 answer

Syntax error in string in query expression 'ID = 4

I am using Visual Basic 2010 express to control a Ms.Access 2007 database. I am struggling in adding a record to the database. I get the Syntax error in string in query expression 'ID = 4 Here is my code : If ComboBox1.Text = "" Or TxtJam.Text = ""…
nurana
  • 31
  • 1
  • 1
  • 4
2
votes
3 answers

How do I parse VBA code line instructions

I am trying to create a VBA function that parses VBA code. I'm at the stage where I'm trying to put in an array variable all the instructions present on a line of code. For example the following code contains two instructions: strVar = "Some…
ODEXT
  • 19
  • 4
2
votes
0 answers

How to convert VBA file in PERL to vbaProject.bin directly without using the excel file?

Or compile VB file to .exe in Perl? I am using the unzip command to extract the VBA-bin from the sample XLSM excel file. unzip -j xl/sample.xlsm xl/vbaProject.bin I have the same macro code in the sample.vb file in a git directory. I am generating…
himmat
  • 159
  • 5
2
votes
1 answer

What's the VBAProject keyword?

In the Object Browser window there's a list of the libraries being used. By default it comes with: Excel (Microsoft Excel version Object Library) Office (Microsoft Office version Object Library) stdole (OLE Automation) VBA (Visual Basic For…
user7393973
  • 2,270
  • 1
  • 20
  • 58
2
votes
2 answers

Mass importing modules & references in VBA

I have a set of ~10 modules/forms/classes that I like to use and reuse for many many projects. Usually these modules are coming in at the middle or the end of the project, not the start (So no making a template and using that from the start - I use…
Selkie
  • 1,215
  • 1
  • 17
  • 34
2
votes
2 answers

BackUp+Restore IDE bookmarks at a specific line of code

Well, the title is because I had a hard time walking through some unbearable docs and finding what I was looking for so, if these keywords can help for other google searches... Then, when quitting Excel, all previously marked lines of code are lost…
foxtrott
  • 55
  • 7
2
votes
1 answer

Excel/VBA code ignores inputted arguments

I have a VBA sub that should load in user code modules when needed. My issue is that when I pass ("ModuleA",".bas") the code will return "ModuleB". ModuleB does not exist (was deleted) within the filepath specified. How can this code return a…
610163
  • 25
  • 3
2
votes
1 answer

VBA Error Handler that emails me when errors occur

I have created an error handler for a larger program that will email me when an error occurs which includes what line the error is happening on and the code for the whole function/sub that it happen in. The issue is that this code relies completely…
Guy Cothal
  • 1,268
  • 1
  • 10
  • 20