Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

geting error in GetObject function

Status
Not open for further replies.

laks143

Programmer
Apr 20, 2009
20
GB
Hi
i am trying to read & copying the content of an excel which is already opened to another excel i am getting 'Activex component cannot create object' error messge. please correct the following code.

Dim sheet
Dim sheet1
Set sheet = CreateObject("excel.application")
sheet.Visible = True
sheet.Workbooks.Open "C:\Documents and Settings\1055214\Desktop\mysheet.xls", True, False
Set sheet1 = GetObject(, "FFC047_AoM_Test_Tree.xls")
'sheet1.Visible = True
'sheet1.Workbooks.Open "\\rtdom.com\file\ITOpsAylesbury\Shared\IT UK TESTING\Servicing Systems Team\CPAS+\c. FS Releases\INV_09_R3\FFC047 Analysis of Movement (Phase IV)\d. Correspondence\FFC047_AoM_Test_Tree.xls"
sheet.Worksheets(1).Cells(1, 1) = sheet1.Worksheets("FFC047").Cells(32, 1)


Thanks in Advance!!!
 
[red]Set sheet = CreateObject("excel.application")[/red]

Set sheet = GetObject(,"excel.application")

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top