Controlling another application
Controlling another application
Controlling another application
Controlling another application
Controlling another application
Controlling another application Controlling another application Controlling another application Controlling another application Controlling another application Controlling another application Controlling another application Controlling another application
Controlling another application Controlling another application
Controlling another application
Go Back  Xtreme Visual Basic Talk > > > Controlling another application


Reply
 
Thread Tools Display Modes
  #1  
Old 02-02-2004, 10:33 AM
DocHollywood DocHollywood is offline
Newcomer
 
Join Date: Feb 2004
Posts: 1
Question Controlling another application


Hey All,

I'm writing an application which will take data from an Excel Spreadsheet and enter it into an existing application which I did not develop and do not have access to the source code. I do know that the application was written in Visual Basic 6 though, so hopefully that will help a bit.

I however and developing in VB.net

What I would like is to somewhat take control of the external application (TCG) and input data into fields on the form. Nearly all fields are MSflexgrid's, but some fields do require a double-click to activate a hidden combobox.

I have considered sending Keystrokes to TCG, but this is a very unstable method.


Is there any way I can take control of the program using API or another method to directly access data fields or objects even though TCG was not written for communication purposes?
Reply With Quote
  #2  
Old 02-02-2004, 03:37 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

Hey Doc,

(I love the Username btw.)

I don't know about controlling TCG here. I'm guessing that SendKeys might be the best that one can do with this, but I'm not an expert on that. Hopefully someone will happen by that is better at this than I.

Hopefully the degree to which you wish to Automate/Control Excel is not too extensive. OLE Automation using .Net is technically feasible and I wrote a Tutorial on the process, but as a practical matter I find it, well, pretty impractical.

Using VB6 to Automate/control Excel is 100x easier and far less mistake prone. MSFT did their best to make .Net backwards compatible with COM using what they call the 'COM Interop', but it really is extremely finicky to use.

At a minimum, I would get a sense of it by reading the Tutorial here:
VB.Net Office Integration FAQ as well as some of the other threads on this sub-forum, including here: http://www.xtremevbtalk.com/showthread.php?p=610020.

I hope this helps, but I also hope that someone will come by with some more ideas about how to control TCG... I just don't know of any way besides SendKeys either...

-- Mike
__________________
My Articles:
| Excel from .NET | Excel RibbonX using VBA | Excel from VB6 | CVErr in .NET | MVP |
Avatar by Lebb
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
multi connections, one port? burningodzilla Communications 5 08-02-2005 06:04 PM
setting up an API reference to an exteral application dshaw API 7 12-19-2003 09:02 PM
Determine whether client application is running KenChen Communications 3 04-06-2003 09:43 AM
Global.asa for each application Sylvain Web Programming 7 07-08-2002 10:38 AM

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
Controlling another application
Controlling another application
Controlling another application Controlling another application
Controlling another application
Controlling another application
Controlling another application Controlling another application Controlling another application Controlling another application Controlling another application Controlling another application Controlling another application
Controlling another application
Controlling another application
 
Controlling another application
Controlling another application
 
-->