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)"