Use VBA macro to copy Excel data paste in another app

vantilian

New Member
Joined
Mar 3, 2002
Messages
44
I will simplify this question and my data structure in order to glean some general VBA principles. I believe if I get a basic jumpstart I can build off of it. I'm a VBA novice, but use books/internet to get by. My situation is as follows.

I have data in Column A in an Excel 2002 worksheet (in this case an 8-digit numerical value), which needs to be copied 12 rows at a time, and pasted into 12 available rows within another application. The "other" application may be the hangup because it is not a Microsoft application. I am pasting the data into the application Reflections For IBM, which is terminal emulation software. My problem comes in where I would like the VBA script to activate the Reflections application and paste the data. I have the simple VBA code below, but it does not activate the Reflections session (session name is Genesis.rsf). Also, if I can get this working, I would eventually use relative cell references to move the copy function down 12 rows at a time. I have a very simple, isolated 12 row copy below.

ActiveCell.Range("A1:A12").Select
Selection.Copy
Windows("Genesis.rsf - Reflection - IBM 5250 Terminal").Activate
...I'll have to figure out some way to position the cursor at this point, and paste the data. Then I would like the Macro to return to the Excel window.

Does anyone have any suggestions or know if Excel and Reflections can work together within the VBA script?

Please let me know if I can provide any additional information that would be helpful. Thanks for your time.

Russell
 
VBA - Copy Data from Excel and Paste Into Reflection for IBM

Okay, I've narrowed this issue down to basically needing to know how to activate the Reflection session from within the Excel/VBA script. As a precursor, I've gone into the VBA Editor->Tools->References area and made available the Reflection program as an Object. I just can't figure out the VBA code that would switch over to the Reflection session in order to Paste the data. Here is what I have so far:

Dim XLApp As Excel.Application

Dim TargetSheet As Worksheet

Set TargetSheet = ActiveWorkbook.Sheets("Target Check")
Sheets("Target Check").Select
ActiveCell.Range("A1:A12").Select
Selection.Copy

ActiveCell.Offset(12, 0).Range("A1").Select

'At this point need VBA script to switch to Reflections session and Paste

I appreciate any help that can be provided. Thanks for your time.

Russell
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top