Home > Software engineering >  How other software by VBA calling excel add-in (SOLVER) to implement the planning? How to declare th
How other software by VBA calling excel add-in (SOLVER) to implement the planning? How to declare th

Time:09-22

Has the solver in excel, but I think in other VBA embedded in the software by VB call excel record data after using solver to planning, SOLVER32. DLL cannot be added to the reference of other software, so I think it is a standard library? Need private declare? But I don't know the inner function structure, so the statements should be how to write? Otherwise will not be able to call SET CELL, SOLVER OK command, such as


VBA in other software with reference no solver inside, and I manually add SOLVER32. DLL display will not be able to add the reference, I'm not successful registration by regsvr32, so feel it is a standard library? But how to declare that its internal function to be called? (I was recorded by excel in macro, recorded a solver of solving process code, copy it to the other software with VBA, run to the solver is not ok, before this has opened the excel)

CodePudding user response:

CodePudding user response:

CodePudding user response:

Don't be A language code is modified to B language code busywork,
Also don't use A language code to directly invoke B language code base, this complicated things so easy to get wrong,
Just make A, B language code of input and output is redirected to A text file, or modify A, B language code let it through text file input and output,
Can easily make A, B coordination between the two languages,
For example:
A will request data written to A file a.t xt, renamed after finish aa. TXT
B find aa. TXT, read its contents, call the corresponding function, and writes the results file b.t xt, after finish delete aa. TXT, changed its name to bb. TXT
Found A bb. TXT, read the content, after finish delete bb. TXT
Above can be replaced by any kind of A language or development environment, B can be replaced by any kind of with the development of A different language or development environment,
Unless A or B does not support to determine whether A file exists, file read and write and file name,
But who can name does not support to determine whether a file exists, file read and write and file name for the development of language or development environment?
Can put the temporary files on the RamDisk efficiency decrease wear disk,
Data structure is very complex, a text file format problems refer to a json or XML

The communication methods between the temporary text file sharing this process there are plenty of advantages, compared to other method only listed below I can think of now:
Loose coupling between process,
Can be on the same machine, process, also can cross machine, across the operating system, hardware platform, and even multinational,
, convenient debugging, and monitoring, only let the third party or artificial view the temporary text files,
Switch, convenient online service, need to delete or create the temporary text files,
, is convenient to realize distributed and load balancing,
Services to provide convenient, queue, queue is full and it is almost impossible to happen (unless the hard disk space full)
DE...

"Across different languages, machine, across the operating system, hardware platform, multinational, cross *. *" misery,
Back is "the use of Shared a plain text file information communication" of the shore!

CodePudding user response:

reference zhao4zhong1 reply: 3/f
don't do A language code is modified to B language code busywork,
Also don't use A language code to directly invoke B language code base, this complicated things so easy to get wrong,
Just make A, B language code of input and output is redirected to A text file, or modify A, B language code let it through text file input and output,
Can easily make A, B coordination between the two languages,
For example:
A will request data written to A file a.t xt, renamed after finish aa. TXT
B find aa. TXT, read its contents, call the corresponding function, and writes the results file b.t xt, after finish delete aa. TXT, changed its name to bb. TXT
Found A bb. TXT, read the content, after finish delete bb. TXT
Above can be replaced by any kind of A language or development environment, B can be replaced by any kind of with the development of A different language or development environment,
Unless A or B does not support to determine whether A file exists, file read and write and file name,
But who can name does not support to determine whether a file exists, file read and write and file name for the development of language or development environment?
Can put the temporary files on the RamDisk efficiency decrease wear disk,
Data structure is very complex, a text file format problems refer to a json or XML

The communication methods between the temporary text file sharing this process there are plenty of advantages, compared to other method only listed below I can think of now:
Loose coupling between process,
Can be on the same machine, process, also can cross machine, across the operating system, hardware platform, and even multinational,
, convenient debugging, and monitoring, only let the third party or artificial view the temporary text files,
Switch, convenient online service, need to delete or create the temporary text files,
, is convenient to realize distributed and load balancing,
Services to provide convenient, queue, queue is full and it is almost impossible to happen (unless the hard disk space full)
DE...

"Across different languages, machine, across the operating system, hardware platform, multinational, cross *. *" misery,
Back is "the use of Shared a plain text file information communication" of the shore!


How can I detect text has changed? And how to change this event is triggered by text excel automatically read and processed? I want to automate so write in VBA to unity

CodePudding user response:

Simple is the last modification time interval must be time polling file
Can use API ReadDirectoryChangesW or complex FindFirstChangeNotification

CodePudding user response:

Then call the inside of the excel vba.

Excel set "trust access to VB project"

The set xlApp=CreateObject (" excel. Application ")
The set xlbook=xlApp. Workbooks. Open (" D: \ Desktop \ test. XLS ")
The set xlsheet=xlbook. Worksheets (" sheetA ")
XlApp. Visible=True
XlApp. Run xlsheet test_start_Click

CodePudding user response:

Upstairs the other big suddenly a copy of this crap on one thousand times

You can see who has solved the problem because this pile of rubbish

CodePudding user response:

refer to 7th floor aspower_ response:
upstairs that other big suddenly a copy of this crap on one thousand times

Who is you can look at because this crap solved the problem of

That's just because you as long as you don't met I don't need to tell way is no other way to challenge,
Do not believe you try
BASIC on the Apple] [please - Win10 64 f #
  •  Tags:  
  • VBA
  • Related