Run-time error 1004: cannot run the macro 'Solver[InsertFuction]' - vba

Basically, this issues arises from this topic: SolverOptions: How to find the parameter position (AssumeNonNeg)?
When I open a file and import the .bas file and run it, everything works fine. However, when I try to apply the same procedure for all similar files using shell via VB script, I am getting the following error:
Run-time error 1004: cannot run the macro 'SolverReset'. The macro may
not be available in this workbook
I initially tried without SolverReset and in that case I got an error saying
Run-time error 1004: cannot run the macro 'Solver' The macro may not be available in this workbook.
It looks like as if Excel is not activating Solver add-in? What might be the problem here?
Thank you!

After many trials the following worked for me:
in front of each Solver function (eg. SolverReset, SolverOptions, etc.) I put Solver.xlam! and ran the code. It didn't work but gave a warning that there was no Solver.XLAM in the directory. So I simply went to the folder C:\Program Files\Microsoft Office\Office15\Library\SOLVER and copied both Solver.XLAM and Solver32.DLL to the directory. That was it!
Hope someone finds this useful!

Related

VBA list of errors in IDE

I'm working with the VBA IDE provided with Access, and although when there's an error the offending line of code turns red, I can't for the life of me find a way to view the error.
Note that my question is not how to fix this error, but simply how to view the error that is making this code red.
There is no option to show the error window, and I'm at a loss. Any help is welcome!

MetConv.txt error on Office 2007 (Word)

I've installed a MACRO in MS-word2007 (was working correctly until then) and sometimes (not always), when I use the Macro, this error popup appears
An error has occurred in the MetConv.txt file, refer to the
MetConv.log file
I've searched for a solution and the recurrent one is to disable 'features'. Obviously if i disable the 'feature', te macro doesn't work.
I could solve it installing the VC++ 2008 runtime (for the OS + ServicePack i was using).

Run time error "5981" Could not open macro storage

I'm getting this error message: "Run-time error 5981. Could not open macro Storage" This happens when I'm creating a new Word document using a template. The code is posted below. When we run this macro. It create a new document but it shows the error. Please help where i am doing wrong.
Sub AddTemplate1()
Documents.Add Template:="C:\Program Files\Microsoft Office\Templates\Letter_Portrait_Template_CONFIDENTIAL.dotx"
End Sub
I also experienced this error.
After weeks of searching the internet, tried everything what was suggested: Setting authorization, renewed my Normal.dotm etc etc.
I finally solved the problem by changing the compatibility - mode from 'windows xp' to its normal mode (windows 10 in my case) for the (yes outdated) VB6.exe

VBA won't compile? "Error Accessing the system Registry"

I was working on a Form and then Access crashed. When I tried to open it, I was prompted with an error which I didn't recognize how to fix right away. Something like
Form1 doesn't exist , if the invalid form name is in a macro ...
At the time, I couldn't figure it out, so I hit "Compact and Repair", closed and re-opened access a few times. Then there was another message, don't exactly remember but soemhting like "To continue, all VBA code must be deleted." I said Ok, because I have a few back up copies. But that didn't fix anything.
Then I figured out how to fix the original error. "Form1" was my default form to open on startup, so I changed it. So everything works, I copy the code back in, but obviously the code doesn't work. The error message is:
Compile Error user defined type
on the DAO.QueryDef
Then I follow MS Help and check the references, and when I click on Tools -> References, I get
Error acessing the System Registry.
So, any thoughts that include not messsing with the Registry?
Ok, so the real problem was the
Compile Error: User-Defined Type Not Defined
iDevelop was right, the file was corrupted. I had to make a new access file (they were .accdb not .mbd , but some concept), and import all objects without the code.
To make sure wasn't corrupted, I copy pasted it into Notepad first, and then into the new file. (Just as an extra precaution). And then it worked.
I am still getting the error:
Error accessing the System Registry.
when I go into Tools-> references,
but, I think it is probably related to my permissions, so maybe it is intended.

Modernizr bunch of errors

I'm currently looking into modernizr (modernizr.com) and when I look at the source in an IDE, I get a bunch of errors on line 813 such as:
-Function created in a loop
-Undeclared variable
-Missing semicolon
-Expected ")"
-Etc...
I just wanted to know if this is normal/a fault of the IDE because it appears to be functioning normally. You can see the source, copy pasted from here
Was just a weird IDE bug in c9.op turns out the code has no problems!