AnsweredAssumed Answered

vrf AW: ActiveX question

Question asked by VRFuser on Mar 18, 2003

Hi,
one way is to use two different 'Object Variables'
for your two excel-files. You can then easily switch
between both files:

set ExcelApp1=CreateObject("excel.application");
ExcelApp1.workbooks.open("FileA.xls");
set ExcelApp2=CreateObject("excel.application");
ExcelApp2.workbooks.open("FileB.xls");

ExcelApp1.Range("A1:U20").Copy;
ExcelApp2.Worksheets(2).Activate;
ExcelApp2.Range("C1").Select;
ExcelApp2.ActiveSheet.Paste;

Hope this helps

Rolf Neumann
TriQuint Europe GmbH



> -----Ursprngliche Nachricht-----
> Von: Thomas.Mitchell@Autoliv.com [mailto:Thomas.Mitchell@Autoliv.com]
> Gesendet am: Mittwoch, 19. Mrz 2003 14:54
> An: VEE vrf
> Betreff: [vrf] ActiveX question
>
> I'm making some progress working with ActiveX and Excel.  My
> question is
> this.  I have 2 Excel files that I need to open.  File A, and
> file B.  Then
> I need to transfer/copy a range of cells from sheet 1 of fileA, to a
> different starting point on a different sheet of fileB.
>
> Example: Copy from sheet1.fileA, range
> (row2Col1..........row20col10)  to
> sheet3.fileB, range starting at row100Col5.  I can open both
> FileA, and
> fileB, but I cannot figure out how to actually activate the
> 2nd excel file
> sheet.  I tried a quick example of just trying to read cells
> from both that
> didn't work. But I can't figure out how to activate or switch
> from a sheet
> in one file to a sheet in another file.
>
> Any ideas?
>
> Thanks,
>
> Tom Mitchell
> Autoliv AEA


---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@it.lists.it.agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".

Outcomes