vbe

Rubberduck UI submenus are disabled

社会主义新天地 提交于 2019-12-04 23:09:47
I've just installed the Rubberduck VBE add-in v2.0.11.2453 (MSIL) on Windows 10 OS. When I open a macro-enabled Excel workbook in Excel and launch the VBA editor, Rubberduck starts but all commands under the Rubberduck menu are disabled. What am I doing wrong? Disclaimer: I'm heavily involved with the development of the Rubberduck add-in. You did nothing wrong =) In earlier alpha 2.x releases we discovered that launching the initial parse on startup was causing problems (violent crashes), because the add-in was, essentially, ready before the VBE had finished setting up the object model for the

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

血红的双手。 提交于 2019-12-04 22:00:01
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 any way to automate the find-and-replace procedure? ChipsLetten Add this code to a new macro-enabled workbook. Set the FIND_WHAT and REPLACE_WITH constants, open the other workbooks and run the code. The original code comes from Charles Pearson's site WARNING: Only basic testing has been done! Option Explicit Sub ReplaceTextInCodeModules() ' Must add a reference to "Microsoft Visual Basic For

VBA - Find all numbered lines in VBE Modules via pattern search

非 Y 不嫁゛ 提交于 2019-12-03 21:34:14
问题 Task: My goal is to find all numbered lines in procedures of my Code Modules. The CodeModule.Find method can be used to check for search terms (target parameter). Syntax: object. Find (target, startline, startcol, endline, endcol [, wholeword] [, matchcase] [, patternsearch ]) The referring help site https://msdn.microsoft.com/en-us/library/aa443952(v=vs.60).aspx states: parameter patternsearch : Optional. A Boolean value specifying whether or not the target string is a regular expression

Is there a way in VBA to know about variables that aren't being used? [closed]

。_饼干妹妹 提交于 2019-12-03 11:51:58
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Is there a tool, method or setting in the standard VBA Editor to warn about variables that have been Dim 'med, but aren't being used? Jon Fournier MZ-Tools will search through your code and tell you what is not being used. The version for VBA can be found here . The specific feature in MZ-Tools that performs what you asking about is Review Source Code : The Review Source Code feature allows you to review the source code

Delete a Module in Outlook Project

半世苍凉 提交于 2019-12-02 07:57:42
Can I delete an Outlook VBA Module? I have tried the below code: Dim vbMod As Object Set vbMod = Application.VBE.ActiveVBProject.VBComponents vbMod.Remove VBComponent:=vbMod.Item("Module2") But getting an error: 438 Error, Object doesn't support this property or method Can this be done with Outlook VBA and are there any References to be included? Try this. You will need to add a reference to Microsoft Visual Basic for Applications Extensibility 5.3 . Public Sub DeleteModule(ByVal ModuleName As String) On Error GoTo Trap Dim VBAEditor As VBIDE.VBE Dim objProject As VBIDE.VBProject Dim

Can not see the add in after installing rubberduck?

一笑奈何 提交于 2019-12-01 08:33:35
I am new to rubberduck and have installed the latest version 2.0.11. After admin installed, I go to excel and check my com-addins and it does now show rubberduck there. I've check my programdata folder and yes, rubberduck is there with all files ect. It is just not showing up on my add in for excel. Help? OS: windows 7 pro Excel 2007 64bit Mathieu Guindon Disclaimer: I am one of the founders of the Rubberduck project Rubberduck is a VBE add-in, not an Excel or COM add-in; if it's properly registered as a VBE add-in you'll find it in the VBE's Add-In Manager , from the Add-Ins menu: note: avoid

VBA - Find all numbered lines in VBE Modules via pattern search

自古美人都是妖i 提交于 2019-11-30 23:55:59
Task: My goal is to find all numbered lines in procedures of my Code Modules. The CodeModule.Find method can be used to check for search terms (target parameter). Syntax: object. Find (target, startline, startcol, endline, endcol [, wholeword] [, matchcase] [, patternsearch ]) The referring help site https://msdn.microsoft.com/en-us/library/aa443952(v=vs.60).aspx states: parameter patternsearch : Optional. A Boolean value specifying whether or not the target string is a regular expression pattern. If True, the target string is a regular expression pattern. False is the default. As explained

Why does this code compile when pasted in but fail otherwise?

别说谁变了你拦得住时间么 提交于 2019-11-30 17:53:00
A friend made me look at this page , and noticed a strange piece of code in the signature of one of the forum users. The code is a one-liner that goes as follows: On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0 Scrolling removed: On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop:

How to restore VBA Editor to its initial settings?

杀马特。学长 韩版系。学妹 提交于 2019-11-29 10:01:46
How to restore the VBA Editor to its intial settings ? I have some troubles with macro and projects explorer windows settings, after some bad manipulations. The only way I know how to accomplish this is to edit the registry. Close All Office programs Open a command prompt and type regedit Navigate to HKEY_CURRENTUSER\Software\Microsoft\VBA\6.0\Common Right click on Common and Export to save the *.reg file somewhere safe. This is your back up. Double clicking this file will restore your current settings. Right click on Common and Delete it. Doing this will remove all of its subkeys that hold

How to programmatically change conditional compilation properties of a VBA project

孤者浪人 提交于 2019-11-29 01:30:29
I'm currently working on a VBA code generator/injector that adds VBA functionality to Excel workbooks by using the VBA Extensibility. This all works fine. However, the original code that is injected uses conditional compilation, referring to some global conditional compilation arguments: Is there any way I can programmatically modify/add the conditional compilation arguments of a VBA project? I checked all properties of the VBProject but couldn't find anything. Peter Albert Inspired by this approach , shown by SiddharthRout, I managed to find the following solution using SendMessage and