I would like to be able to have the macro code "check" the box in VBA Tools>References so that the user does not have to do this. This would make the macro more portable. This would come in handy for both VLOOKUP and SOLVER macros. Any suggestions?
I would like to be able to have the macro code "check" the box in VBA Tools>References so that the user does not have to do this. This would make the macro more portable. This would come in handy for both VLOOKUP and SOLVER macros. Any suggestions?
Perhaps any of these links could be of help?
http://visualbasic.ittoolbox.com/gro...talled-3650039
http://stackoverflow.com/questions/1...and-referenced
Alf
Alf,
Thank you for your response. While these both refer to code to check to see if these are added in (which work, I checked), neither does the "adding-in".
I am working up a demo for class, and it is possible that the user has not added in Solver. While we can check if it is added in (thank you -- I will add a "check" button to the user interface), the issue remains whether we can add Solver by using VBA in the macro itself. Wouldn't it be cleaner, in terms of making a general interface, not to have to instruct the user to open up the VBA window, find Tools, find References, find and check Solver? Perhaps this is wishful thinking on my part. And perhaps it is my failure to understand why Solver and VLOOKUP, among other things, are not automatically available in VBA.
Thank you for directing me to the checking code.
Pam
If you lower the security settings, you could use http://www.ozgrid.com/forum/showthread.php?t=42486
Must say I also had little sucess trying to set a reference to Solver using a macro. The problem I think could be from where to find solver.neither does the "adding-in".
If you are using a 32bits window (XP for instance) and a 32bit offece (office 2003) then the solver.xla file is probably found at
"C:\Program Files\Microsoft Office\OFFICE11\Library\SOLVER\solver.xla"
Using Windows 7 32bit and Office 2007 also 32 bit you will find the Solver.xlam (yes name changed to xlam") at
"C:\Program Files\Microsoft Office\OFFICE12\Library\SOLVER\solver.xlam"
If your Windows is 64 bit and your office 32 bit solver is found at
"C:\Program Files(x86)\Microsoft Office\OFFICE12\Library\SOLVER\solver.xlam"
If your Office 2007 is also 64 bit then it will be
"C:\Program Files\Microsoft Office\OFFICE12\Library\SOLVER\solver.xlam"
For Office 2010 depending on 32 or 64 bit (Program Files(x86) or just Program Files) and Office14 but file is still called Solver.xlam
What the folder is for Office 2013 I don't know and these are only the default instalation folders you may chose your own "specific" instalation folder.
If you are setting up a demo I think it's better to show how to install / setting a reference to solver.
Well you are not the only one , mysel I've also wondered why this is so.And perhaps it is my failure to understand why Solver and VLOOKUP, among other things, are not automatically available in VBA.
Alf
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks