Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy Excel file to a existing Excel sheet
Message
De
13/09/2004 07:23:48
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
13/09/2004 06:46:29
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00939891
Message ID:
00941558
Vues:
16
oExcel.DisplayAlerts = .f.
oExcel.ActiveWorkbook.SaveAs('c:\mypath\NewXLSName.xls') && If you wnat to rename XLS

oExcel.Activeworkbook.ActiveSheet.Name = 'NewName' && If you want to rename sheet
or something like:
oExcel.Workbooks(nIndex).Sheets('OldName').Name = 'NewName' && If you want to rename sheet
Cetin

>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform