Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Word, PowerPoint, Outlook, and Other Office Products > String evaluation using vba6.dll / MSOffice


Reply
 
Thread Tools Display Modes
  #1  
Old 09-11-2003, 08:04 AM
ValentinBadea's Avatar
ValentinBadea ValentinBadea is offline
Regular
 
Join Date: May 2003
Location: Romania, Bucharest
Posts: 92
Default String evaluation using vba6.dll / MSOffice


Salut,
Please answer me:
1) It's possible to use Microsoft Office engine - a file from this program ) to integrate it into a VB program for evaluating string expresion ? Excel provides a lot of useful function (ex. MIN, MAX, LOOKUP, etc.).
2) How can I use (for the scope mentionated above) the file vba6.dll (and EbExecuteLine). Any information about that (links,attachments) ?[INDENT] Thank you !
Reply With Quote
  #2  
Old 09-11-2003, 09:09 AM
Timbo's Avatar
Timbo Timbo is offline
Green-Eyed

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Bangkok, Thailand
Posts: 10,261
Default

Add the 'MS Excel Object Library x.x' reference to your project, then you can use the various functions in the form:
x = objExcelApplication.WorksheetFunction.NameOfFunction(Arguments)
__________________
"He's not the Messiah. He's a very naughty boy!" - Brian's mum

Can't find the answer? >> Try something new!
Become a Professional
Reply With Quote
  #3  
Old 09-12-2003, 12:19 AM
ValentinBadea's Avatar
ValentinBadea ValentinBadea is offline
Regular
 
Join Date: May 2003
Location: Romania, Bucharest
Posts: 92
Default

Thank you for start.
I Added the 'MS Excel Object Library x.x' reference to my project and this simple code that works ! I think is a better way for evaluating strings.
Code:
Private Sub Command1_Click() Text1.Text = "MIN(23,14)" Text2.Text = Excel.Evaluate(Text1.Text) End Sub
Thank you again !
Reply With Quote
  #4  
Old 09-12-2003, 06:22 AM
CarlR CarlR is offline
Junior Contributor
 
Join Date: Aug 2003
Posts: 331
Default

ValentinBadea,

I would be cautious about using Excel in the background to evaluation expressions. For the simple reason that if the person attempting to run the VB program doesn't have Excel installed on their machine, or a different version of Excel, you're going to have problems getting the code to work.

There are a lot of ActiveX and VB add-ins that you could incorporate into your project that won't require the User to be using Excel in the background.

CarlR
Reply With Quote
  #5  
Old 09-15-2003, 12:53 AM
ValentinBadea's Avatar
ValentinBadea ValentinBadea is offline
Regular
 
Join Date: May 2003
Location: Romania, Bucharest
Posts: 92
Default

Reply to CarlR :
It isn't the same thing if I incorporate in References 'Ms Excel ....olb' or an other ActiveX ? I'll incorporate this component in setup program.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting a file in dat question ? murphys General 5 11-06-2002 08:34 PM
Open an associated Text Document knoxitis General 19 05-01-2002 11:26 PM
Shareware Registry Protection Technigue karachi999 General 2 01-21-2002 02:40 PM
Loop to format file kingesk General 2 09-10-2000 05:01 PM
File format problem kingesk General 1 09-08-2000 04:52 PM

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
 
 
-->