Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Khurram Tahir
  Where is Khurram Tahir?
 Karachi
 Pakistan
 Khurram Tahir
 Tags
Subject: Createobject() VS GetObject() for Excel
Thread ID: 226541 Message ID: 226541 # Views: 26 # Ratings: 0
Version: Visual FoxPro 9 Category: Microsoft Office Automation
Date: Saturday, May 02, 2009 10:09:23 AM         
   


Q. Which method is better and i have to adopt between the following , please explain the following too ?

loExcel = Createobject('Excel.Application')
loWorkbook = loExcel.Workbooks.open('d:\FrxXls\Abc.xls')
loSheet = loWorkbook.Sheets(1) && or pass the name of your sheet as a string!
loExcel.Visible = .t. && display Excel


*********** OR *************

Tmpsheet = GetObject('','Excel.Sheet')

XLApp = Tmpsheet.Application

XLApp.Visible = .t.
XLApp.WorkBooks.Add()
XLSheet = XLApp.ActiveSheet




COMPLETE THREAD
Createobject() VS GetObject() for Excel Posted by Khurram Tahir @ 5/2/2009 10:09:23 AM
RE: Createobject() VS GetObject() Posted by Mike Gagnon @ 5/2/2009 12:36:57 PM