Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an Access database application that creates an excel application, an
excel spreadsheet and formats all the data in the appropriate rows and columns of a worksheet. I would like to launch Solver from the new excel application, but I cannot run it. I have loaded solver in my references, and if I look through the addins of the newly created spreadsheet, it's there. Of course, Access itself does not recognize the solver addin. Any ideas (including how to generate excel modules from an access program, then execute the resulting module)? Alternatively, is there a similar addin for Access (sorry that this is not the forum for that)? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you are opening excel from access using automation, then addins are not
loaded automatically to speed things up. Here is some sample Excel code to add the solver addin and crate a reference to it: (written by Dana DeLouise) Sub SolverInstall() '// Dana DeLouis Dim wb As Workbook On Error Resume Next ' Set a Reference to the workbook that will hold Solver Set wb = ActiveWorkbook With wb.VBProject.References .Remove .Item("SOLVER") End With With AddIns("Solver Add-In") .Installed = False .Installed = True wb.VBProject.References.AddFromFile .FullName End With End Sub http://support.microsoft.com/default...b;en-us;843304 How to create Visual Basic macros by using Excel Solver in Excel 97 -- Regards, Tom Ogilvy "Dinosaur51" wrote: I have an Access database application that creates an excel application, an excel spreadsheet and formats all the data in the appropriate rows and columns of a worksheet. I would like to launch Solver from the new excel application, but I cannot run it. I have loaded solver in my references, and if I look through the addins of the newly created spreadsheet, it's there. Of course, Access itself does not recognize the solver addin. Any ideas (including how to generate excel modules from an access program, then execute the resulting module)? Alternatively, is there a similar addin for Access (sorry that this is not the forum for that)? Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I tried this from Access 2003 and got the following problems:
It would not let me access VBProject saying "Programmatic access to VBProject not trusted." the statement wb.VBProject.References.Remove.Item("SOLVER") came back highlighting .Remove and saying "Argument not optional" the statement app.wb.application solverOK (etc) returns a Function or subfunction not defined. I don't seem able to get beyond the compiler (interpreter, or whatever). Thanks for your help. "Tom Ogilvy" wrote: If you are opening excel from access using automation, then addins are not loaded automatically to speed things up. Here is some sample Excel code to add the solver addin and crate a reference to it: (written by Dana DeLouise) Sub SolverInstall() '// Dana DeLouis Dim wb As Workbook On Error Resume Next ' Set a Reference to the workbook that will hold Solver Set wb = ActiveWorkbook With wb.VBProject.References .Remove .Item("SOLVER") End With With AddIns("Solver Add-In") .Installed = False .Installed = True wb.VBProject.References.AddFromFile .FullName End With End Sub http://support.microsoft.com/default...b;en-us;843304 How to create Visual Basic macros by using Excel Solver in Excel 97 -- Regards, Tom Ogilvy "Dinosaur51" wrote: I have an Access database application that creates an excel application, an excel spreadsheet and formats all the data in the appropriate rows and columns of a worksheet. I would like to launch Solver from the new excel application, but I cannot run it. I have loaded solver in my references, and if I look through the addins of the newly created spreadsheet, it's there. Of course, Access itself does not recognize the solver addin. Any ideas (including how to generate excel modules from an access program, then execute the resulting module)? Alternatively, is there a similar addin for Access (sorry that this is not the forum for that)? Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Accest to the Project is a security setting made by the user. That can't be
overridden with code. YOu can change that in Excel in tools=Macros=Security Trusted Publishers Tab, at the bottom left, select the two checkboxes. the code I posted looked like this: With wb.VBProject.References .Remove .Item("SOLVER") End With Note that there is a space between .Remove and .Item -- Regards, Tom Ogilvy "Dinosaur51" wrote: I tried this from Access 2003 and got the following problems: It would not let me access VBProject saying "Programmatic access to VBProject not trusted." the statement wb.VBProject.References.Remove.Item("SOLVER") came back highlighting .Remove and saying "Argument not optional" the statement app.wb.application solverOK (etc) returns a Function or subfunction not defined. I don't seem able to get beyond the compiler (interpreter, or whatever). Thanks for your help. "Tom Ogilvy" wrote: If you are opening excel from access using automation, then addins are not loaded automatically to speed things up. Here is some sample Excel code to add the solver addin and crate a reference to it: (written by Dana DeLouise) Sub SolverInstall() '// Dana DeLouis Dim wb As Workbook On Error Resume Next ' Set a Reference to the workbook that will hold Solver Set wb = ActiveWorkbook With wb.VBProject.References .Remove .Item("SOLVER") End With With AddIns("Solver Add-In") .Installed = False .Installed = True wb.VBProject.References.AddFromFile .FullName End With End Sub http://support.microsoft.com/default...b;en-us;843304 How to create Visual Basic macros by using Excel Solver in Excel 97 -- Regards, Tom Ogilvy "Dinosaur51" wrote: I have an Access database application that creates an excel application, an excel spreadsheet and formats all the data in the appropriate rows and columns of a worksheet. I would like to launch Solver from the new excel application, but I cannot run it. I have loaded solver in my references, and if I look through the addins of the newly created spreadsheet, it's there. Of course, Access itself does not recognize the solver addin. Any ideas (including how to generate excel modules from an access program, then execute the resulting module)? Alternatively, is there a similar addin for Access (sorry that this is not the forum for that)? Thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oh, the joys of proportional fonts! Thanks for the clarification. In Access,
one of the check boxes (the lower one) is "greyed out" and cannot be selected. In Excel, I did it, but it does not save the setting and must be set everytime by the user, in the newly created spreadsheet before the statement is executed. I suppose being able to change that "programatically", as they say, would be a breach of security! Once it is selected, it comes back that "SOLVER" is out of range. This seemed like such a good idea, too! Do you know of any REASONABLY priced optimization packages (something less than the $1500 that Solver.com wants), or a way to hack into solver.dll? So near, yet so far! Regards, Mike "Tom Ogilvy" wrote: Accest to the Project is a security setting made by the user. That can't be overridden with code. YOu can change that in Excel in tools=Macros=Security Trusted Publishers Tab, at the bottom left, select the two checkboxes. the code I posted looked like this: With wb.VBProject.References .Remove .Item("SOLVER") End With Note that there is a space between .Remove and .Item -- Regards, Tom Ogilvy "Dinosaur51" wrote: I tried this from Access 2003 and got the following problems: It would not let me access VBProject saying "Programmatic access to VBProject not trusted." the statement wb.VBProject.References.Remove.Item("SOLVER") came back highlighting .Remove and saying "Argument not optional" the statement app.wb.application solverOK (etc) returns a Function or subfunction not defined. I don't seem able to get beyond the compiler (interpreter, or whatever). Thanks for your help. "Tom Ogilvy" wrote: If you are opening excel from access using automation, then addins are not loaded automatically to speed things up. Here is some sample Excel code to add the solver addin and crate a reference to it: (written by Dana DeLouise) Sub SolverInstall() '// Dana DeLouis Dim wb As Workbook On Error Resume Next ' Set a Reference to the workbook that will hold Solver Set wb = ActiveWorkbook With wb.VBProject.References .Remove .Item("SOLVER") End With With AddIns("Solver Add-In") .Installed = False .Installed = True wb.VBProject.References.AddFromFile .FullName End With End Sub http://support.microsoft.com/default...b;en-us;843304 How to create Visual Basic macros by using Excel Solver in Excel 97 -- Regards, Tom Ogilvy "Dinosaur51" wrote: I have an Access database application that creates an excel application, an excel spreadsheet and formats all the data in the appropriate rows and columns of a worksheet. I would like to launch Solver from the new excel application, but I cannot run it. I have loaded solver in my references, and if I look through the addins of the newly created spreadsheet, it's there. Of course, Access itself does not recognize the solver addin. Any ideas (including how to generate excel modules from an access program, then execute the resulting module)? Alternatively, is there a similar addin for Access (sorry that this is not the forum for that)? Thanks |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Correction to my previous reply. Once the created spreadsheet was closed, now
new spreadsheets are created with that box checked. The other comment of subscript out of range still applies, though. Thx Mike "Tom Ogilvy" wrote: Accest to the Project is a security setting made by the user. That can't be overridden with code. YOu can change that in Excel in tools=Macros=Security Trusted Publishers Tab, at the bottom left, select the two checkboxes. the code I posted looked like this: With wb.VBProject.References .Remove .Item("SOLVER") End With Note that there is a space between .Remove and .Item -- Regards, Tom Ogilvy "Dinosaur51" wrote: I tried this from Access 2003 and got the following problems: It would not let me access VBProject saying "Programmatic access to VBProject not trusted." the statement wb.VBProject.References.Remove.Item("SOLVER") came back highlighting .Remove and saying "Argument not optional" the statement app.wb.application solverOK (etc) returns a Function or subfunction not defined. I don't seem able to get beyond the compiler (interpreter, or whatever). Thanks for your help. "Tom Ogilvy" wrote: If you are opening excel from access using automation, then addins are not loaded automatically to speed things up. Here is some sample Excel code to add the solver addin and crate a reference to it: (written by Dana DeLouise) Sub SolverInstall() '// Dana DeLouis Dim wb As Workbook On Error Resume Next ' Set a Reference to the workbook that will hold Solver Set wb = ActiveWorkbook With wb.VBProject.References .Remove .Item("SOLVER") End With With AddIns("Solver Add-In") .Installed = False .Installed = True wb.VBProject.References.AddFromFile .FullName End With End Sub http://support.microsoft.com/default...b;en-us;843304 How to create Visual Basic macros by using Excel Solver in Excel 97 -- Regards, Tom Ogilvy "Dinosaur51" wrote: I have an Access database application that creates an excel application, an excel spreadsheet and formats all the data in the appropriate rows and columns of a worksheet. I would like to launch Solver from the new excel application, but I cannot run it. I have loaded solver in my references, and if I look through the addins of the newly created spreadsheet, it's there. Of course, Access itself does not recognize the solver addin. Any ideas (including how to generate excel modules from an access program, then execute the resulting module)? Alternatively, is there a similar addin for Access (sorry that this is not the forum for that)? Thanks |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can open solver just like a workbook using workbooks.open
that would get it loaded. Whether it would then work properly with code, I can't say, but it is worth testing. Solver is a generalized optimizer (therefore probably involved and complex) - if you have a specific problem, perhaps you can code the algorithm to solve it. -- Regards, Tom Ogilvy "Dinosaur51" wrote: Correction to my previous reply. Once the created spreadsheet was closed, now new spreadsheets are created with that box checked. The other comment of subscript out of range still applies, though. Thx Mike "Tom Ogilvy" wrote: Accest to the Project is a security setting made by the user. That can't be overridden with code. YOu can change that in Excel in tools=Macros=Security Trusted Publishers Tab, at the bottom left, select the two checkboxes. the code I posted looked like this: With wb.VBProject.References .Remove .Item("SOLVER") End With Note that there is a space between .Remove and .Item -- Regards, Tom Ogilvy "Dinosaur51" wrote: I tried this from Access 2003 and got the following problems: It would not let me access VBProject saying "Programmatic access to VBProject not trusted." the statement wb.VBProject.References.Remove.Item("SOLVER") came back highlighting .Remove and saying "Argument not optional" the statement app.wb.application solverOK (etc) returns a Function or subfunction not defined. I don't seem able to get beyond the compiler (interpreter, or whatever). Thanks for your help. "Tom Ogilvy" wrote: If you are opening excel from access using automation, then addins are not loaded automatically to speed things up. Here is some sample Excel code to add the solver addin and crate a reference to it: (written by Dana DeLouise) Sub SolverInstall() '// Dana DeLouis Dim wb As Workbook On Error Resume Next ' Set a Reference to the workbook that will hold Solver Set wb = ActiveWorkbook With wb.VBProject.References .Remove .Item("SOLVER") End With With AddIns("Solver Add-In") .Installed = False .Installed = True wb.VBProject.References.AddFromFile .FullName End With End Sub http://support.microsoft.com/default...b;en-us;843304 How to create Visual Basic macros by using Excel Solver in Excel 97 -- Regards, Tom Ogilvy "Dinosaur51" wrote: I have an Access database application that creates an excel application, an excel spreadsheet and formats all the data in the appropriate rows and columns of a worksheet. I would like to launch Solver from the new excel application, but I cannot run it. I have loaded solver in my references, and if I look through the addins of the newly created spreadsheet, it's there. Of course, Access itself does not recognize the solver addin. Any ideas (including how to generate excel modules from an access program, then execute the resulting module)? Alternatively, is there a similar addin for Access (sorry that this is not the forum for that)? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I use Visual Basic to access Solver? | Excel Programming | |||
Can I run Visual Basic procedure using Excel Visual Basic editor? | Excel Programming | |||
changing the visual basic in office 2003 to visual studio net | Excel Discussion (Misc queries) | |||
Solver in Visual Basic | Excel Programming | |||
Visual Basic Macro For Solver | Excel Programming |