Can MScheduler paste Excel cell contents to another app?

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Reese

Can MScheduler paste Excel cell contents to another app?

Post by Reese » Wed Sep 22, 2004 12:06 am

I am attempting to take the contents of an excel file or a csv file and paste the contents of specific cells into the fields of another application. Does anyone have any advice as to how I could do this?

Any help is greatly appreciated.

Reese Williams
[email protected]

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Sep 22, 2004 5:33 am

Here is an outline of one way to do it. untested, no real code, just a skeleton.
Open Excel
Set Focus> Excel window

Goto> Cell 1
CTL-C (to copy cell1 to clipboard)
GetClipBoard>Value1 (to assign clipboard value to variable)

Do previous 3 lines above for all 8 cells, can use a counter and subroutine and do above 8 times. Change numbers for 1-8 as needed.

Close Excel

Open Application 2
Set Focus> For Application 2

Goto> location for Value1
Send Text>%Value1%

Do previous 2 lines for all 8 values, can use a counter and subroutine and do above 8 times. Change numbers for 1-8 as needed.

Close Application 2.
Someone may also be able to show you how to use DDE to get info from Excel. Don't know if you can use DDE with Application 2.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Wed Sep 22, 2004 7:55 am

Or, a more seamless way to do this would be to use VBScript and ADO to read in the CSV file line by line and paste the data into the other app. This removes the need to open Excel and automate it.

As Bob says you can also use DDE to grab data from Excel. There should be examples at http://www.mjtnet.com/scripts.hts and also here on this forum - use the search facility.
MJT Net Support
[email protected]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts