how to incorporate the Validation Application Block into your application
To prepare your application
- Add a reference to the Validation Application Block assembly. In Visual Studio, right-click your project node in Solution Explorer, and then click Add References. Click the Browse tab and find the location of the Microsoft.Practices.EnterpriseLibrary.Validation.dll assembly. Select the assembly, and then click OK to add the reference.
- Use the same procedure to set a reference to the Enterprise Library Common assembly, named Microsoft.Practices.EnterpriseLibrary.Common.dll.
- Follow the same procedure to set a reference to the ObjectBuilder assembly, Microsoft.Practices.EnterpriseLibrary.ObjectBuilder 2 .dll.
- If you are using the ASP.NET, Windows Forms, or WCF integration assemblies, add one of the following references as appropriate.
- Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.dll
- Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet.dll
- Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF.dll
- (Optional) To use elements from the Validation Application Block without fully qualifying the type with the namespace, add the following using statements (C#) or Imports statements (Visual Basic) to the top of your source code file.
C#
using Microsoft.Practices.EnterpriseLibrary.Validation; using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;
Visual Basic
Imports Microsoft.Practices.EnterpriseLibrary.Validation Imports Microsoft.Practices.EnterpriseLibrary.Validation.Validators
Note:
For Visual Basic projects, you can use the References page of the Project Designer to manage references and imported namespaces. To access the References page, select a project node in Solution Explorer. On the Project menu, click Properties. When the Project Designer appears, click the References tab.
Posted in: .NET Framework| Tags: Reference Block Application Validation Application Block Validation Incorporate Coding Assembly Microsoft click dll integration enterpriselibrarySolverFinish Function in Excel 2007 development
Tells Microsoft Office Excel what to do with the results and what kind of report to create when the solution process is completed.
Before you use this function, you must establish a reference to the Solver add-in. In the Visual Basic Editor, with a module active, click References on the Tools menu, and then select the Solver.xlam check box under Available References. If Solver.xlam does not appear under Available References, click Browse and open Solver.xlam in the \office12\library\Solver subfolder.
SolverFinish( KeepFinal , ReportArray )
ReportArray Optional Variant. The kind of report that Excel will create when Solver is finished: 1 creates an answer report, 2 creates a sensitivity report, and 3 creates a limit report. Use the Array function to specify the reports you want to display — for example, ReportArray:= Array(1,3).
Example
This example loads the previously calculated Solver model stored on Sheet1, solves the model again, and then generates an answer report on a new worksheet.
Worksheets("Sheet1").Activate
SolverLoad LoadArea:=Range("A33:A38")
SolverSolve UserFinish:=True
SolverFinish KeepFinal:=1, ReportArray:=Array(1) Posted in: Office Development| Tags: Office Excel 2007 Function Development excel solver click references solverfinish reportarray available xlam