Excel version 2002 - copy-paste data from mainframe to spreadsheet

N

Newsgroups

Please, I need help.

I am using a mainframe connectivity application (called Vista TN3270) to pull data (realtime) from mainframe screens and paste that data into Excel using copy function of TN3270 and the paste function from Excel.

I copy the info from mainframe into the clipboard and then I created an AutoOpen macro in Excel that opens, pastes the data from the clipboard, saves the data, then closes it and returns back to the TN3270 program for the next round. However, after I have completed gathering data for one client and I have pasted across from A1....AF1, I am ready to move to the next row to start
pasting the next set of the same data into A2...AF2, but I cannot figure out how to move the active cell to A2 within this circular data copy/paste stream once it has completed its first set of data.

I open the Excel file by keying into the TN3270 mainframe program's scripting/macro and type in ShellExecute("open",c:\file.xls,"","",1). This shellexecute causes the excel file to open and the autoopen macro takes over and grabs the data was copied into the clipboard and pastes it into the next cell to the right of the last cell. But, now, I'm stuck when the next set of similar data is copied over because I really want the next set of data to start on the next line. I could let it go and copy the new data next to the first set of data and so forth until it reachs the right side's limit - and then the macro cannot complete it's call to paste to the next cell because it cannot find one next to the last cell to the right and it errors out.

Is there a way to cause a specific cell to return me to the next row?
Is there a way to start up the excel file (c:\file.xls) and tell it to go to a specific cell (A2, for instance)?
Is there a way to start up the excel file (c:\file.xls) and add further arguments that will start a macro within the .xls file that I am using?

Am I thinking about it all wrong?

I welcome anyone's help.
Thanks,
David
 
J

Jim Rech

One way to have an opening workbook paste what's in the clipboard in the
next available cell on a specific sheet is like this:

Sub Auto_Open()
On Error Resume Next ''In case clipboard is empty
Worksheets("Sheet1").Range("A65536").End(xlUp).Offset(1).PasteSpecial
xlAll
End Sub


Btw, this code works even if the result goes in more than one cell, that is,
Excel is smart enough to know that even though the macro specifies only one
cell, it should paste in multiple cells based on the data.


--
Jim
Please, I need help.

I am using a mainframe connectivity application (called Vista TN3270) to
pull data (realtime) from mainframe screens and paste that data into Excel
using copy function of TN3270 and the paste function from Excel.

I copy the info from mainframe into the clipboard and then I created an
AutoOpen macro in Excel that opens, pastes the data from the clipboard,
saves the data, then closes it and returns back to the TN3270 program for
the next round. However, after I have completed gathering data for one
client and I have pasted across from A1....AF1, I am ready to move to the
next row to start
pasting the next set of the same data into A2...AF2, but I cannot figure out
how to move the active cell to A2 within this circular data copy/paste
stream once it has completed its first set of data.

I open the Excel file by keying into the TN3270 mainframe program's
scripting/macro and type in ShellExecute("open",c:\file.xls,"","",1).
This shellexecute causes the excel file to open and the autoopen macro takes
over and grabs the data was copied into the clipboard and pastes it into the
next cell to the right of the last cell. But, now, I'm stuck when the next
set of similar data is copied over because I really want the next set of
data to start on the next line. I could let it go and copy the new data next
to the first set of data and so forth until it reachs the right side's
limit - and then the macro cannot complete it's call to paste to the next
cell because it cannot find one next to the last cell to the right and it
errors out.

Is there a way to cause a specific cell to return me to the next row?
Is there a way to start up the excel file (c:\file.xls) and tell it to go to
a specific cell (A2, for instance)?
Is there a way to start up the excel file (c:\file.xls) and add further
arguments that will start a macro within the .xls file that I am using?

Am I thinking about it all wrong?

I welcome anyone's help.
Thanks,
David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top