Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy Excel file to a existing Excel sheet
Message
From
13/09/2004 06:46:29
 
 
To
07/09/2004 10:28:16
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00939891
Message ID:
00941554
Views:
18
Hi Cetin

Thanks. It´s working.

But now I have another "small" problem

After using Bookworks.add

How do I rename the new Excel docunent and how do I save it? I have tryied Bookworks.name and Bookworks.save but both returns errors.

Hope you can help me with this.


>>HI
>>
>>I have a blank Excel sheet and I want to copy an existing Excel file into this sheet.
>>
>>How can it be done ??
>
>
lcXLSFrom = "C:\myPath\mySource.xls"
>lcFromSheet = 'MySourceSheet'
>LOCAL loExcel,loRange
>loExcel = CreateObject("Excel.Application")
>with loExcel
> .Workbooks.Open(lcXLSFrom)
> loRange = .ActiveWorkbook.Sheets(lcFromSheet).UsedRange
> .Workbooks.Add
> loRange.Copy(.ActiveWorkbook.ActiveSheet.Range('A1'))
> .WorkBooks(1).Close
> .Visible = .T.
>ENDWITH
Cetin
Benn Kjaer
MS Certified Professional - Visual Foxpro

"There is something rotten in the state of Denmark"
"Why make user-friendly programs, when there aren’t any friendly users :o)"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform