VBA editor opens by itself

Foo_Man_Chu

Board Regular
Joined
Jul 22, 2010
Messages
79
Hi All,
I'm running Excel 2007 on a Windows 7 64 bit machine. My VBA editor keeps opening on it's own and is starting to become very annoying. This issue was addressed in this post:

http://www.mrexcel.com/forum/showthread.php?t=222957

but it was never answered. Can anyone give me some additional insight into why this is happening and more importantly how to stop it? Thanks in advance!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Is there any code running in the workbook? Are there any addins or other customizations running? Are you allowing macros or disabling macros? Have you installed all Windows and office updates and patches?
 
Upvote 0
Are you creating controls at run time?

This is from memory, so the syntax might not be exact, but this code might be useful
Code:
VBE.MainWindow.Visible = False
 
Upvote 0
Are you creating controls at run time?

This is from memory, so the syntax might not be exact, but this code might be useful
Code:
VBE.MainWindow.Visible = False


Thanks for this Mike, your mention of creating controls at runtime got my attentions and your code got me over the line. The actual code I used was:

Code:
VBComp.VBE.MainWindow.Visible = False


VBComp declared as follows, thanks to help from Mr Pearson:

Code:
    Set VBComp = oProject.VBComponents("ThisWorkbook")
    
    Set CodeMod = VBComp.CodeModule
       
    With CodeMod
        LineNum = .CreateEventProc("SheetBeforeDoubleClick", "Workbook")
        LineNum = LineNum + 1
        .InsertLines LineNum, " Dim sCellAddress As String "
        LineNum = LineNum + 1
        .InsertLines LineNum, " Dim lCurrRow As Integer "
        LineNum = LineNum + 1
        .InsertLines LineNum, "sCellAddress = ActiveCell.Address"
        LineNum = LineNum + 1
        .InsertLines LineNum, "lCurrRow = ActiveCell.Row + 1"
        LineNum = LineNum + 1
        .InsertLines LineNum, "Rows(lCurrRow & " & DQUOTE & ":" & DQUOTE & " & lCurrRow).Select"
        LineNum = LineNum + 1
        .InsertLines LineNum, "Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove"
    End With
 
Upvote 0
It's really strange, I'm probably 'intruding'here but I have been looking for answers since one or two days.
I have an xlam file I run, not install and it has been working fine.
The vba properties are set to non visible and is password protected.
Since a day or tow when the file is closed, using a button om the custom ribbon menu I wrote I get the password box to open the vba editor, if I enter the correct or incorrect password, if yous says that there was a problem and excel will close, but nothing else.
Entering the correct password no difference.
OS: Windows 10 64-bit, Office 2010 and everything was fine.
VBA Editor window is not maximized (as I read on several posts), and when I remove the password and save it and then reopen the vbe editor does not show up anymore when closing.
If I run the invoked macro the same.
Very strange and especially I do not like thing I do not understand, no changes made and I do not address the VBE components in any way.
Any ideas?
 
Upvote 0

Forum statistics

Threads
1,213,490
Messages
6,113,957
Members
448,535
Latest member
alrossman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top