How to set up the correct 'View' for VBA Project in Microsoft Excel? - excel

Not sure if this is the correct place to post this but this issue is driving me insane....
The Issue:
I have come to use my PC after the weekend and for some reason the layout of the VBA Project stuff is completely messed up...
Usually when my VBA is set up very nicely in what I believe is the standard viewing mode IE the Project box to the left and the code to right and the intermediate window at the bottom...
For some reason now I get the following:
As you can see it is just the code...
I then click on the project explorer window and the project details appear, but as one ridiculously large page....
Then I minimise the window and alter its shape to try and get it at least look like it used to...
I can live with this to an extent although everything is floating and annoying... But now, every time I click onto a module (to view the code). It opens each module as its own seperate window!
This as you can imagine is unsustainable when working with as lot of code and having to flick between different modules
What I have Tried:
I have tried looking in different settings and I can not see anything different...
I have restarted my PC and it is still the same...
I have tired opening a different spreadsheet and still the same....
Does anyone have any suggestions? I just want it to be back to the simple layout of everything joined together etc...

Related

excel active X buttons getting bigger every action

This is a question with the same title as here:
VBA Active-X buttons getting bigger with every action
I guess the problem is the same.
The question is nevertheless from 2014!!! and it does not really have an answer.
In my case the buttons were NOT created programatically, but just clicking in insert activeX control, button, and then click for writing the VBA behind.
In order to better illustrate the problem I made a video with my handy:
https://www.youtube.com/watch?v=hBiu2FfRxQU
IN the video you can see how every time a button is clicked it gets bigger.
as note aside I have to say that this only happens when I connect remotely with my computer via a think client. Nevertheless both screens are the same (i.e. have the same resolution).
This is of course very annoying because it makes almost impossible to use home working since connecting to my excel at work makes all the buttons go crazy in size.
As #TimStack and #jvdv has pointed out this is a known issue of Microsoft, i.e. a BUG, there since many years.
Hence there is no solution but workarounds.
So stay away from controlX if you don't want to get surprises.
I had faced this issue today itself. And found very strange solution to this problem.
I just tried to resize the button where I was facing the issue and it was solved.
Hope this works with you.

Excel Deployment - resizing and other component display issues

I have been working on a project in excel for a while and am having problems deploying it to my client. We have (exactly) the same version of excel but when he opens the file the sizing of the components is all wrong. Please see the screenshots below:
When he turns on design mode or clicks and holds the vertical scroll bar, the issue corrects itself for the most part:
But when compared to the original there are still issues, such as the "Rental Start" and "Rental End" labels.
I should also mention that this problem is not isolated to this project. We had some issues with a different one, as well, but never made the connection between design mode and couldn't figure it out. I have tried my IntegralHeight property per a forum post somewhere, as well as double checking that my components are not set to size with cells. Does anyone know why this might be occurring? He has windows 8.1 and I have 7, if that could be the difference.
Note: All controls are ActiveX controls.

Excel ActiveX Button is clickable, but does not work

About a week ago, I found that all ActiveX buttons stopped working in all spreadsheets, when running on my computer. They work on others just fine. There had been no issues for the past year.
I know there was recently a Windows updates that caused a stir, preventing people from even being able to click on ActiveX buttons. The issue I am experiencing seems to be different... I am able to click on the button (once clicked, it will show the dotted line around the perimeter of the button). however, nothing happens.
I have these buttons created to open User forms. I have checked to verify the PrivateSub code still exists to launch the form on the Button Click.
Since all my staff are still able to use the spreadsheets and ActiveX buttons, I am thinking there is something occurring locally on my computer, and it is not necessarily programming related, but I have had no luck finding any cause.
Any ideas?
I found a solution to the issue. It appears as though my issue WAS still related to the Microsoft update.. I just happened to be experiencing a different symptom, and needed a different solution as well (rather than just delete MSForms.exd files)
I recompiled the projects (Open VBEditor, Debug Menu, Compile VBA Project), saved workbook, closed excel, and re-opened. Everything worked as normal again.
Unfortunately, I need to do this for all files I work with which have ActiveX controls, which is several dozen.

Excel 2007-VBA, Right Click Buttons

I am having a strange Excel 2007 issue, and I am not quite sure how to explain this. So bear with me please....
I have created a few right click buttons to call various backend VBA functions that I have written. They were working fine earlier today, and now for some reason, a button is appearing that is not from the code in my worksheet. When you click it, it is attempting to open another worksheet and execute code from it. The two files are not in the same directory nor are they named anything similar. I deleted the file that the button is trying to execute from and now it just simply gives me an error 400.
So, I couldn’t figure that out, and have since deleted every single scrap of code in the backend of this file, and the button still appears. Any ideas what could be causing this? It seems like maybe its mixing files up or saving a copy somewhere in a temp directory and trying to access that instead of the actual code that is written in the VBA. Is there a cache I need to clear out or something?
I know I didn’t exactly do a great job describing this, so I will be more than happy to provide any and all other details that you may need. Just let me know what is going on.
EDIT #1 -- New Information ==
I can even open a new, completely blank excel file and the right click button is still there.
EDIT #2 -- Tried Diagnostics ==
I just tried running the Excel diagnostics and it found no problems. It is strange, it is like this macro has somehow became global or stored in some type of cache or something.
I hope I'm understanding your issue correctly.
If you know what right-click (context) menus the button is appearing in you should be able to fix them with a Reset command. For example if it's appearing in the Cell context menu, you could try this in the VBE's Immediate window:
Application.Commandbars("Cell").Reset
This will reset the entire menu to its default state.
Also, you might be interested in a tool I wrote, MenuRighter, that allows you to tweak your right-click menus. It also has a setting to show you the Caption and ID of any context menu.

VBA editor auto-deletes spaces at the ends of lines

Is there a way to convince the VBA editor in Excel to stop auto-formatting lines to remove the space at the end when I pause in my typing for a quarter second?
I had this exact problem and the following worked for me.
Click the Microsoft Office Button, and then click Excel Options
Click the Add-Ins category
In the Manage box, click COM Add-ins, and then click Go.
Look for an add in called 'Load Test Report AddIn' then uncheck it
restart excel
This addin is installed with VS2010 Beta2
In Excel 2010, toggling Design Mode button on the Developer Ribbon Tab solves the problem for me.
I've definitely had that issue before, where the vba editor would format as I was typing (not just when I went to another line). For me, it seemed to be related to a Microsoft Web Browser control that I had in an open workbook. When I took out the web browser, the VBA editor started acting normally again. I have no idea why that worked, but it did. Now I avoid using that control in my workbooks.
Something is causing your spreadsheet to recalculate while you are in the VBA Editor and this 'compiles' your code and thus strips the spaces. You need to stop the cells recalculating while you are editing. Turning the calculation to manual in the spreadsheet.
Tools > Options > Calculation should do the trick.
I noticed this when I had cells recalculating thanks to a DDE connection.
There is sort of a way to turn off the auto-"correction" in the VBA Editor.
Tools Menu -> Options -> Editor Tab -> Clear the Auto Syntax Check box
Sadly, this won't solve all your problems, as the VBA Editor tends to have a mind of its own, for better or worse.
Taking it out of design mode fixes it every-time on vba2003 - its was driving me crazy at first ... i did notice it might have something to do with the web control but when i take it out of design mode it works fine ... just toggle that to get it to behave :)
I have had this same problem several times recently, and has driven me crazy.
After reading this post all the different fix-ups mentioned (none worked for me), I recalled I have been playing lately with Internet Explorer Control, opening Internet Explorer from VBA.
This is mentioned in some of the answers in this post.
This got me in the right path and, in order to fix it, I had to first delete all iexplore.exe instances (alt+control+delete), closed Excel and open excel again.
(iexplore.exe had been opened invisible from the VBA code, and I didn't know they were running)
That fixed the bug.
I have been programming quite heavily with VBA for over 4 years, and never had this problem.
Just a couple of weeks ago I started using IE control, and I started getting this problem...so in my case I can only assume the bug is directly related to the IE control.
I am running both excel 2003 and 2007 in same PC at the same time, and the problem only happens with excel 2007.
None of the above for me.
I had a Application.OnTime timer that fired every second and this triggered a recalculation of something: commenting it made my day.
This has started happening to me recently after adding a Timer event to an Access 2007 form. The VB editor "finalizes" the current line (as if you had moved the cursor off of the statement; I have auto syntax checking off) each time the event fires (initially I had it set to 1 second, now it is set to 5 seconds, and the behavior scales accordingly). In order for the event code to execute, the application has to ensure that it has been compiled. Presumably, the editor needs to be in a "sane" state to do this, as it probably has to check for code dependencies among modules. Note that the behavior occurs regardless of whether any dependent code is actually loaded into the editor at the time. Note also that resetting the execution state doesn't affect the timer event firing. As a practical matter, one could close the triggering form, switch it to design view, set a breakpoint in the triggered code, or increase the timer interval while working with the editor.
In contrast to abhishek's comment, changing the settings of Tools/Options.../General/Compile On Demand and/or Background Compile did not affect the issue.
If it helps, none of the previous answers solved mine. Only solution appeared to be to close the xls file and reopen it. Frustrating to have to do every 30 mins but at least it works. Would love to know why it's recompiling and cleaning the text... should really be an option to disable the text cleanup but couldn't find it.
Turn off Tools > Options > General > Background Compile. This solved it for me.
This is a long standing problem that could have various causes. I had this same issue occur in the Access VBE (so naturally the Excel answers weren't relevant). After a LOT of digging I finally got it fixed with the solution below. First a recap though:
If you are here because of this issue in Excel, try the solutions above first. To summarize:
The most common issue in Excel is that the Design button is toggled. Toggle that and see if the behavior changes as submitted by Dmitry Frenkel above
If that doesn't work, check for the "Load Test Report" AddIn as mentioned by Ade.
Those are really the two main causes in Excel, but if neither of those solutions work, then scroll through the rest of the solutions here. All are valid possibilities for the cause. In Access the cause is pretty straight forward. It's a timer issue on a form somewhere. I found this solution from here by User Kevin K. Sullivan.
Copy the following line of code onto the clipboard. (You might need to
paste it into a text editor first and coerce it onto one line, depending on
your newsreader. It must be one line.)
For i = 0 to Forms.Count -1: Debug.Print Forms(i).Name, Forms(i).TimerInterval: Next i
Switch to Access.
Press Ctrl-G to go to the Immediate Window.
Press Ctrl-V to paste in the code.
Press enter to to run the code. All open forms will be listed. Any non-zero timer intervals are your culprits. Simply close that form (It may be invisibly open from another process than the one you thought you were dealing with).
I think the solution for Access here is what the user Dom was trying to say above. I guess the down votes were because it wasn't explained very well and/or because he was speaking of Access when the OG issue was in Excel. Regardless, he is likely on point if you are here because of the VBE in Access.
I hope this helps people. I know I kept finding this page when researching this issue, so that's why I thought I'd update this solution here.
I hit this problem today on a fresh install of Excel 2010 Beta 2. None of the above made any difference, but going into the trust center and disabling all application add-ins fixed the problem for me.
I have Office 2010 Pro and I had the same issue. As I type the space between each word was being deleted. After trying each of the options turning them on and off the only way I found working was to disable the Winzip Courie(excel) add-in. This is done thru the Options dialog box Add-Ins section.
In office 365 I had the same issue - what worked for me is I saved the file with a different name and when I re-opened the new file the problem went away.
I found this issue pops up when I had AutoSave on. Turning that off let me code without it compiling every second.
I don't think I've ever seen the VBE remove a space when I've stopped typing. It will remove trailling spaces from lines if you move to another line, but that's something different and not behaviour that I think can be altered.
The removal of spaces in the VBA editor for Access occurs when a form is open in Form("Execute") mode. This is probably due to background executions based on "On Timer" methods. Close the form in Access solves the problem in VBA.

Resources