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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

xenou

MrExcel MVP
Joined
Mar 2, 2007
Messages
16,836
Office Version
  1. 2019
Platform
  1. Windows
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?
 

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
24,072
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
 

nummyofthedowd

New Member
Joined
Apr 10, 2013
Messages
13
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
 

Keebellah

Board Regular
Joined
Feb 4, 2014
Messages
79
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?
 

Forum statistics

Threads
1,141,728
Messages
5,708,137
Members
421,549
Latest member
Dtcfire

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
Top