Back to Solver !!! Need Help
Back to Solver !!! Need Help
Back to Solver !!! Need Help
Back to Solver !!! Need Help
Back to Solver !!! Need Help
Back to Solver !!! Need Help Back to Solver !!! Need Help Back to Solver !!! Need Help Back to Solver !!! Need Help Back to Solver !!! Need Help Back to Solver !!! Need Help Back to Solver !!! Need Help Back to Solver !!! Need Help
Back to Solver !!! Need Help Back to Solver !!! Need Help
Back to Solver !!! Need Help
Go Back  Xtreme Visual Basic Talk > > > Back to Solver !!! Need Help


Reply
 
Thread Tools Display Modes
  #21  
Old 11-21-2004, 12:25 PM
ssk ssk is offline
Freshman
 
Join Date: Sep 2004
Posts: 44
Default


Hi Mike,

The things you said are true. I want to clarify somethings over here.

=> What I have done is this. I open a .TXT file as a excel workbook and do some operations on it. Thereby, I cannot store a Macro in that workbook. I need to store the macro in some other workbook which is forever present on the hard-drive. I call this already saved workbook from the program. This saved workbook has the Macro which I intend to use.

=> With the macro and the code that I ahave posted I wanted to call the macro from the program to get to see how it works. That was giving me the error. I already have the solver.xla in the reference.

=> The DE-3 which I have as the target cell is because in the presaved workbook, there are like 105 odd columns (dont remember the exact number) and the target cell is after that. I am just using the macro from that workbook.

I dont think I still sound very clear, but please ask me in case of any doubts.

The application is like this.

>> I open a .TXT file as a sheet in an Excel workbook. I open a few more sheets (one of them is the SOLVER-DATA sheet) which do the data processing.

>> This SOLVER-DATA sheet has the changing cells (D3 - D5, E3 -E5, F3 -F5...and so on). I have to pass these changing cells (each column one at a time) to solver.

>> The target cell to be minimized can always be the same and will be
governed by the equations stated earlier.

The idea is that Solver will minimize the target cell by using the changing cells and the equations. When I save the Excel workbook opened from the .TXT file I want to save the values of the changing cells.

Have a great Thanksgiving folks.

SSK
Reply With Quote
  #22  
Old 11-21-2004, 01:19 PM
Mike Rosenblum's Avatar
Mike Rosenblum Mike Rosenblum is offline
Microsoft Excel MVP

Forum Leader
* Guru *
 
Join Date: Jul 2003
Location: New York, NY, USA
Posts: 7,848
Default

Your code, then, needs to specify more of the process.

Your code needs to:

(1) Open up the Workbook that has the code.
(2) Open up the .Txt file and merge it into the Workbook such that the cell DE3 is the key location.
(3) Make sure that the combined workbook is the Active Workbook and that the key Worksheet in question is the active worksheet.
(4) Lastly, call xlApp.Run("Macro1") to have the Solver do the final work.

I think you have a ways to go here. To be honest, I think you are attempting too much in one step. At this stage, I would content myself with having a Worksheet that is already set-up 100% and then call your "Macro1" on that:

(1) Get the simple Workbook working 100% when called from VBA.

(2) Then get it working 100% when called from VB.Net.

(3) Then, lastly, try splitting it up into the .TXT file / Workbook-With-Code concept that you are envisioning.

You must get the small steps workinsg first, before attempting the full solution... Do it with a very simple workbook with very few formulas. Get that working first!

See you in a week... good luck!

Mike
__________________
My Articles:
| Excel from .NET | Excel RibbonX using VBA | Excel from VB6 | CVErr in .NET | MVP |
Avatar by Lebb

Last edited by Mike Rosenblum; 11-21-2004 at 04:30 PM.
Reply With Quote
  #23  
Old 01-12-2005, 12:55 PM
oirad78 oirad78 is offline
Newcomer
 
Join Date: Jan 2005
Posts: 1
Default

Hi ssk, i've the same problem with the solver. Any news?
Thank you
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Back to Solver !!! Need Help
Back to Solver !!! Need Help
Back to Solver !!! Need Help Back to Solver !!! Need Help
Back to Solver !!! Need Help
Back to Solver !!! Need Help
Back to Solver !!! Need Help Back to Solver !!! Need Help Back to Solver !!! Need Help Back to Solver !!! Need Help Back to Solver !!! Need Help Back to Solver !!! Need Help Back to Solver !!! Need Help
Back to Solver !!! Need Help
Back to Solver !!! Need Help
 
Back to Solver !!! Need Help
Back to Solver !!! Need Help
 
-->