229 questions
1
vote
2
answers
251
views
Changing Worksheet CodeName in VBA
I have a procedure to create a new worksheet.
The name of the worksheet differs based on language localisation selected, so I found it convenient to work with the worksheet codename.
Codename is ...
0
votes
0
answers
71
views
Find option not working in Excel VBA developer window
I am running macro-enabled Excel file in one of the server computers in my organization.
When I try to use the Find option in VBA developer window, it does not work.
For example, when I use Ctrl+F or ...
1
vote
2
answers
170
views
How to extract all properties of an excel chart?
Please run the following code for testing needs.
Public Sub Macro1()
'Delete all charts
For i = ActiveSheet.Shapes.Count To 1 Step -1
If ActiveSheet.Shapes(i).Type = msoChart ...
0
votes
0
answers
121
views
VBA editor in Excel - not accessible and won't respond
When I try to open the VBA editor in Excel (365), the window opens up and no button is clickable, there is just a huge font text in the middle (not readable) - it seems like the text is in Spanish or ...
3
votes
0
answers
1k
views
Excel VBA Editor Won't Let Me Debug My Code: F8 (Step Into) / Ctrl + F8 (Run to Cursor) Not Working
On a pretty regular basis, the VBA Editor breaks somehow, so that I can't step into code (either by pressing F8 or clicking on either the 'Step Into' button or the 'Run to Cursor' button in the "...
0
votes
2
answers
162
views
Accented characters in MsgBox and Project Object in Office 2021 not showing
All language settings (Windows 10, Office 2021) are set to French.
MsgBox does not display the accents.
In the VB Editor:
At run time:
In the Project Object list:
Where is the setting if existing?
...
1
vote
1
answer
65
views
Macro to add code to individual Excel worksheet
The macro below exports data to separate files (a single table / single worksheet to one workbook).
I am attempting to add code to the worksheet to highlight updates made by users to the values in the ...
0
votes
1
answer
104
views
How to intercept VBE errors during automation?
I created a simple tool that extracts an Excel file into a folder and, conversely, gets this folder and regenerates the Excel file.
This tool also extracts the VBA code to text files in order to make ...
0
votes
0
answers
44
views
How Insert Data into Table from Json through VBE Access
I am trying to insert below data into access Table thorough vbe but only one record insert in table
Sample file as below:
{"GenericCorporateAlertRequest":\[{"Alert Sequence No":&...
1
vote
1
answer
86
views
Adding codes to the newly added tab
I am doing a tracker where I have two main tabs - "Home" and "MasterFile".
"Home" is the tab sheet where they will place the date today in cell B2 (since every month we ...
0
votes
0
answers
92
views
VBA coding format changes automatically
Excel VBA was working then the VBE started to have the following issue:
When I type it reformats automatically causing the code to be formatted incorrectly.
Example:
I type:
Range("a2")
...
1
vote
2
answers
232
views
VBE & Access Freeze When Opening Forms in Design View
I've lately been observing that Access and VBE hang for 5-10 minutes when opening a form in Design View. During this time, the application shows as not responding in Task Manager.
This does not occur ...
0
votes
1
answer
61
views
Better way to reference a cell in another worksheet in VBA
Im doing a worksheet in VBA where i need to reference a cell from another worksheet to get a value, is there a better way to do then doing one by one as i am doing in the code bellow.
Sub cotações()
'...
0
votes
2
answers
494
views
How to change a module's code in multiple VBA protected projects
I have multiple Excel files to change automatically one of their module's code. As each VBA project is protected, I need to unprotect each one.
Further information:
https://www.mrexcel.com/board/...
1
vote
0
answers
223
views
I cannot enable macro in my Excel, there is always a pop-up of Microsoft Visual Basic for Applications that says 'missing end bracket'
I found this problem when I want to open an Excel document sent by my co-worker, the file has a macro in it but I can't find a way to enable it.
When I click to enable macros this always happens and ...
0
votes
1
answer
825
views
VBA editor uses wrong language (German)
In Excel, the VBA editor uses German instead of English and I have tried various things to try and change it, such as repairing Office 365 and checking the default language settings, without success. ...
0
votes
1
answer
689
views
Pause/Resume code execution in VBA using a button on a userform
I have Three buttons on a User form Run, Pause, Reset. Reset Button ends the code execution, Pause button Breaks/pause the code execution using STOP Command, Run button should restart the execution. ...
1
vote
1
answer
328
views
VBA Current Line Arrow in Margin Cannot be Moved suddenly
I have been using the vbeditor for many years but suddenly I can no longer "drag & drop" the current line execution arrow like before. I can't interact with it at all. I can't pull it up ...
0
votes
1
answer
157
views
Replace text in multiple workbooks
I am a C++ developer trying to convert something to VBA to replace a call to a legacy ActiveX control.
We have over 100 spreadsheets that rely on an ActiveX control written about 20 years ago. The ...
0
votes
1
answer
330
views
Recorded VBA Macros Appear in VBE but not in Macro List
I have been having tons of trouble with one macro-enabled file in particular. I have numerous Subroutines, all of which are Public and do not require arguments. These macros do not appear in the macro-...
1
vote
0
answers
199
views
Graphics output from Arduino to a PCI SVGA video card
I am working on a retro computer project that needs somewhat high resolution video output (at least 800x600 16 bit color). All retro computers (by this I mean anything before 80286) I am aware of use ...
0
votes
1
answer
95
views
Runtime Error while dynamically adding controls to a userform
I'm getting "Object variable or with block variable not set" (Error 91) on the below mentioned line.
Set cmd = ActiveWorkbook.VBProject.VBComponents("UserForm1").Designer.Controls....
0
votes
1
answer
108
views
Why can't I find any information about object STRUCTURE in Locals window?
I have been trying to understand all of the properties that I see listed in the Locals window in VBE.
Why do some objects have infinitely nested, identical properties? The Range object has a Cells ...
3
votes
2
answers
214
views
How to break up a long formula in VBA editor?
I have a macro that adds a very long formula to one of the cells.
Is there a way to break up this formula in the VBA editor to make it easier to view and edit.
Sheet3.Select
Dim lastrow As Long
...
0
votes
0
answers
31
views
VBComponent.SaveAs object doesn't support this property or method [duplicate]
Compiler says than Componente.SaveAs object doesn't support this property or method.
Microsoft Help: https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/saveas-method-...
0
votes
1
answer
62
views
VBE Intellisense: Is it possible to choose constant from drop down list?
Does VBE Intellisense allows us to choose an Excel constant (xl...) from its dropdown list?
For example, regarding the code below, when I type r., I can choose Cells from a drop-down list. Then, ...
1
vote
0
answers
79
views
VBA Editor: Letter capitalization vs scope of variables
I realized that VBA Editor (Excel 2019 VBE) change case of variables when you have different variables (different scope) but same name with different case.
For example, we have the code below, which ...
0
votes
0
answers
179
views
How to write and show foreign language (Myanmar) character in VBA? [duplicate]
I'm trying to put foreign language (Myanmar/Burmese) in email body.
The word turned into gibberish characters when it is sent, showing "???????".
Is there a step I'm missing or a workaround?
...
0
votes
1
answer
3k
views
Change the CodeName of Template Worksheet: "Run-time Error 1004" Expecting object to be local on line ActiveWorkbook.VBProject.Name = "VBAProject"
What is VBAProject? Is VBAProject my Program.xlsm file because if I replace with that I get the same error.
I tried adding to find the name:
Dim myString As String
myString = ThisWorkbook.VBProject....
1
vote
2
answers
412
views
Application.Startup not called, event code triggers only when Visual Basic Editor is open
Following Outlook VBA code is triggering only when the Visual Basic Editor is open.
I tried other events. All are working when VBA editor screen is open.
Private Sub Application_NewMail()
Dim ...
0
votes
0
answers
179
views
Macro to update linked binary worksheet object in PowerPoint
My company uses a PowerPoint presentation that has linked Excel charts (namely, linked binary worksheet objects). Each month, the name of the workbook changes (from Feb to Mar, for instance) and the ...
0
votes
1
answer
245
views
VBA not recognizing object references in the Hungarian language
One of my Excel VBA programs has a worksheet name in Hungarian that contains a letter not found in English or other Latin-character languages.
Please note I am not referring to “Hungarian Notation” ...
3
votes
2
answers
166
views
VBE Intellisense for named ranges
What is a good practice of getting the named ranges of my sheet from VBE Intellisense?
I have created a workaround of getting the named range from the class module of a sheet, but I think is is too ...
0
votes
2
answers
254
views
VSTO Addin - Add dockable window to VBE Editor
I'm making a VSTO Addin for PowerPoint in C#, which adds a better project explorer. I've been making it in a userform, however it would be better if the window would be part of the VBE editor (aka ...
0
votes
1
answer
4k
views
How to display Japanese characters in VBA editor?
I can't set Sheet.Name property in Japanese. Event file name also displays in maybe Chinese? All display well in Excel.
How can I set up the VBA editor to work with Japanese?
I changed region to ...
3
votes
2
answers
931
views
Excel OLEObject button loses click event after clicking a few times
I was trying to create an Excel button in a sheet from a C# code, using a C# event hander for the button, so I don't have to involve VBA and text scripts; and I found this great solution from @
Dummy ...
2
votes
3
answers
988
views
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 ...
1
vote
1
answer
2k
views
How to stop Visual Basic editor from automatically opening after macro runs?
I have working code where the only issue is that it opens the Visual Basic editor while it's running, closes it, then reopens it when it's finished.
I believe this is because I am creating workbooks, ...
0
votes
3
answers
157
views
How to get autosuggestions for Excel worksheets in Word VBA editor?
Normally when using the VBA editor, code autosuggests from available methods.properties for whatever object being referenced.
I'm trying to pull data from an Excel sheet into a Word document using a ...
-1
votes
1
answer
100
views
Locked from viewing files not listed in VBE Project Explorer as before
After a fresh installation of Windows 11 I am unable to see some of my VB projects in the projects window. These projects were locked for viewing and had passwords set. I know the passwords.
Before ...
0
votes
1
answer
93
views
Translate formula quotation marks incl. replacements into VBA-readable formulae
Translate formula quotation marks incl. replacements into VBA-readable formulae
I was inspired to write this post by the recent question of
formula substitution using a constant.
At the same time, the ...
0
votes
0
answers
888
views
Excel VBE Unhide Module Code Is No Longer Visible
Using Excel 365.
I accidentally clicked to hide a module.
(right-click module >> select Hide)
All this appears to do is close the Project Explorer and Properties Explorer Windows
I clicked View ...
5
votes
3
answers
1k
views
How can I find a word with a new line in the VBA editor using find and replace?
I would like to go through and find all of the "End" statements in my code but skipping all of the "End x" statements like "End If", "End Sub", "End ...
1
vote
1
answer
184
views
How can I change the fontsize in excel365 vba Project Window?
I know how to change the EDITOR code window font but cannot find a way to change the font in the other windows. I don't want to change the screen resolution as I usually have other apps open as well.
...
0
votes
0
answers
78
views
Sub that creates a new sheet opens VBA editor for a fraction of a second
I have a strange behaviour, with both Excel 2010 and Excel 2019 (both in Windows 10 64 bit).
I have a file with lots of VBA code and a certain Sub that creates a new sheet and copies data from two ...
1
vote
1
answer
119
views
How to set the VB Editor default directory?
How does one set the default directory for the VBA Editor?
This ought to be obvious in any application, not to mention an obligatory feature, but I can't figure it out.
Having to navigate up and over ...
0
votes
1
answer
150
views
Replacing a specific element in a line of code
I want to replace certain elements in the code with others.
For example : C.Offset(0, 1).Value = 0 to C.Offset(0, 28).Value = 5
With the help of VbaEditor I can find the number of rows and columns of ...
1
vote
1
answer
389
views
VBA editor opens when I select a file in Windows Explorer
I've written code to change the contents of a cell in multiple protected workbooks looking up the value to be inserted from a table in my worksheet.
The issue I have is that when I select a file in ...
1
vote
0
answers
999
views
How can I Write Own Video Driver for My OS?
While I am writing my own OS, this question comes to my mind!
Is it Possible to write own video drivers like VGA, VESA ( In BIOS ) and GOP, UGA ( In UEFI ) ,if yes then how?
1
vote
1
answer
505
views
Counting Type Variables in Excel vba, possible?
Currently im working with excel vba.
I'm asking myself if there is a possibility to count the variables declared in a user defined Type as shown below.
Public Type NameOfType
a as string
b as ...