Is there a way in VBA-Excel to find how is named the Immediate window in a localized version of Microsoft Office Excel, not English ?
For example, I use an Italian version of Excel, and here Immediate window is called "Immediata",
other, for example Dutch here, called it "Direct"
and so on...
I'm trying to modify a function finded in the page linked above, but I wish to release a version able to work in any localized version of MsO Excel.
Thanks in advance for the answer.
Find Immediate Windows localized name in Excel-VBA
137 views Asked by Emanuele Tinari At
2
There are 2 answers
2
On
The name of the Immediate Window is available in the Window object with the type vbext_wt_Immediate. This type is only available with the correct imports, but all it says is vbext_wt_Immediate = 5. Instead of creating a reference to this, it can be declared and used like this:
Const VBEXT_WT_IMMEDIATE = 5
Function ImmediateLabel() As String
Dim win As Object
For Each win In Application.VBE.Windows
If win.Type = VBEXT_WT_IMMEDIATE Then
ImmediateLabel = win.Caption
End If
Next
End Function
Sub Test()
Debug.Print ImmediateLabel
End Sub