Excel VBA Run Time Error - vba

I was handed a project at work, and when I run the macro, it comes up with this run time error:
When I go to debug the tool, it highlights this piece of code:
I looked at this webpage for help and the workaround says to change settings in Enterprise, and I have no clue what that is.
My questions are:
What is Enterprise and is that the simple work around to this?
What is wrong with that portion of code to make it have this runtime error?
Any help would be appreciated!!

Related

BC30420 'Sub Main' was not found in 'quicktest4'. after finding that this error could be caused by a install fail I repaired visual studio

so I'm new to visual studio and I wanted to use the visual basic functionality of the program but when I try to compile and run my VB I get the BC30420 'Sub Main' was not found in 'quicktest4' error code. I looked around on the internet to see what could cause this and found that it could be and error with the install itself, knowing that I proceeded to use the repair function in the installer and got the same error. I've also tried deleting the entire program and reinstalling and got no change as well. I also read a post on this website saying that it could be something about the properties so I checked there and did not see anything out of place. Link: BC30420 'Sub Main' was not found error in a Windows Form app
Any help would be appreciated greatly, I really would like to actually start building stuff. this has been a two day ordeal so far.
If it involves adding code, please tell me where because this system is pretty foreign to me.
EDIT: Adding a screenshot of the quicktest code itself
code snippet
Check your properties. Sometimes it sets the initial form to main instead of form 1.

ExecuteMso error

This question may have been asked before.
I have tried using ExecuteMso in VBA but returns Method or data member not found.
Not sure what I am doing wrong or if there is an issue using this code as using excel on a Mac. I have also tried this on a windows version of Excel however it is a very old version (if that makes a difference?)
Any help or tips regarding this would be great.
Thanks in advance
The following sample executes the Copy button.
Application.CommandBars.ExecuteMso(“Copy”)
Otherwise, post what you have tried and what is giving you the problem.

VB.NET crashing exception (0xC0000005)

I rename a VB.NET 2010 project and the IDE crash over and over.
I open another project and same result, after a few seconds or if I open Form1.vb the IDE crash.
And the worst part is there's no info about on the Error window.
The only that I can see as an error code is 0xC0000005
Is the only program crashing on my PC so I have my doubts about a hardware issue.
How can I figure out what is happening?
Can somebody give any clue?
Thanks.
First off, take a look at this question where the answer does a good job of explaining the OXC0000005 error, and all that it encompasses.
Second, look at what has changed on your system since the last time you were able to successfully run Visual Studio. I have seen a few cases where a bad windows update was the cause of a user receiving this error. If you have installed updates since the last time you were able to run VS without error, you may want to uninstall those updates and try VS again. If VS works, begin to re-install the updates 1-by-1, testing VS between every update, to determine which update caused the issue.

Visual Studio 2013 Compilation Error - Code not detected properly

Having a very odd issue with Visual Studio 2013, curious if anyone else is seeing anything similar. I have VS 2013 Ultimate, it seems like once a day, while I'm working with a file, the compiler just suddenly freaks out and doesn't detect my code anymore in my web forms. Take a look at the screenshot below (I just chose a random spot in the middle of the web form), but out of nowhere, VS starts erroring, telling me that variables aren't declared, that method arguments need parenthesis on lines of code that aren't methods, all sorts of whacky stuff.
I assure you, I don't have any broken references, I didn't forget to close an if statement.. nothing like that. All I'm doing it writing some code, and randomly the whole page just starts to error like this. To resolve, all I can do is copy the code contents, delete the page, recreate the page, and paste the contents back into my "new" file... same exact code, only no errors. I wouldn't even worry about doing this if I wasn't doing this at least once a day.
Any help is appreciated, thanks!
Edit: For what it's worth, I found a slightly easier workaround for this issue. If I edit the properties of the class file to "Do not Compile" and then back to "Compile", the IDE is able to read the file just fine...
It looks like this is simply a bug in the Vb.Net Compiler / IDE. I agree it's unlikely to be a bug in your code because you can see that the error squiggles don't line up with places that would represent the errors you are reporting. This is sometimes a sign of an IDE bug
In terms of fixing the problem though you can probably get them to go away by closing and reopening the solution in question. Baring that restarting Visual Studio. I wouldn't resort to deleted / recreating the page.
Long term though you may want to file an issue on connect so the IDE team can try and fix the problem.
http://connect.microsoft.com/VisualStudio

VBA in Excel: "Can't find project or library" error when executing in 2007

Using VB for Excel in Excel 2003, I have no problems executing code with some non-declared variables:
numberOfBooks = 0
However, if I try to execute the same code in Excel 2007, I get a "Can't find project or library" error message.
I looked at Tools > Options and I don't have checked "Require Variable declaration". In Excel 2003 I did not use Option Explicit
What am I doing wrong? Thank you very much.
I have seen this advice (check references) a number of times and it makes sense!
However, when the fault: "can't find project or library" develops, you are in run mode and I cannot get out of it?
Waht am I missing?
I'd definitely second Daniel Cook's suggestion of checking your references list; that may be it. However I've come across some situations over the last couple of months where that error will occur in an Excel 2007 even if there is nothing wrong with the references. In part it seems to relate to the security updates that were released in August 12 ( http://technet.microsoft.com/en-us/security/bulletin/ms12-aug ). It caused some breakage in the mscomctl.ocx. The problem and (one) resolution (basically, re-registering the .ocx) is discussed in this IBM link which relates to an Excel add-in for an OLAP product called TM1: http://www-01.ibm.com/support/docview.wss?uid=swg21608271. (The error messages aren't the same as the ones that you've been getting, but I DID get your error messages on another add-in that I wrote which were not missing any references, and it turned out to be the same problem.)
The other thing I'd suggest doing is a purge of your .exd files as discussed here: http://support.microsoft.com/kb/290537 I've also found that those can cause bogus library errors, particularly after a version upgrade.
As for anything else you're doing wrong, well, personally I tend to skin anyone who works for me without using Option Explicit. 8^>
One of our companie's excel-macros (which ran quite frequently without any issues so far) all of a sudden came up with exactly the same error.
We didn't touch the code for like forever. And I honestly have still no idea what actually caused this error. Mistery Microsoft maybe? Anyways.. I finally were able to fix the bug.
Even though "Require Variable declaration" was disabled and Option Exlicit was not set in my case, declaring the variable first did the trick for me:
Dim numberOfBooks As Integer: numberOfBooks = 0
I hope this saves some headaches.