GetObject

Apr 4, 2009

I wrote this code to update(export) 3 cells data to an external spreadsheet. Both spreadsheets are running. I wrote the code with both spreadsheets on one computer just to make sure I had it working. Which it does(like a charm). But when I try to run this over a network there's where it gets into trouble.

Let me explain my limited understanding of how GetObject works:
GetObject() is a two step process

1. It first looks for a running instance that was identified by the strPath. If it finds that running instance then it sets a reference to it.

2. If the first step fails to see the instance as running then it attempts to retrieve's the file and open it on the computer that made the call.

How I have explained steps 1 and 2 is exactly the behavior that I am witnessing which is certainly not what I'm looking for. Step 1 is failing and step 2 does work. Opening an other instance of an already running spreadsheet is unacceptable. I need it to work in the same manner as it did when both spreadsheets were on one computer.

To correct this let me share with you where my reading has taken me:

1.Possible NetWork issue:
I don't think so....It does retrieve the file that GetObject called. But I do wonder if I should set this up on a mapped network drive rather just thru the network.

2. Register as a running instance on the ROT(Running Object Table)
My understanding is the spreadsheet has to lose focus before it is registered. As far as knowing how to determine whether it has been registered I wouldn't have clue. In my situation this just defines the order in which things get launched in the morning. There are other applications launched so to insure Excel loses focus.

3.Launch Microsoft Excel, giving it focus:
Taken from: [url]
Shell "C:Program FilesMicrosoft OfficeOfficeExcel.EXE", _
vbMinimizedFocus 'other options for starting with
'focus: vbMaximizedFocus and vbNormalFocus

View 9 Replies


ADVERTISEMENT

Error - Number:429:' GetObject. ActiveX Component Can't Create Object

Jan 4, 2007

VBScript code snippet below is being used in an ASP page but the call to GetObject never attaches to a running instance of Excel. Since visible property is set to True, I can see the instances accumulate in the TaskBar each time the ASP page is called, so there are obviously instances to attach to.

Dim excelApp
Set excelApp = Server.GetObject(,"Excel.Application")
If (err <> 0) Then
Set excelApp = Server.CreateObject("Excel.Application")
End If
excelApp.UserControl = True
excelApp.Visible = True
excelApp = Nothing

GetObject errors out with the following error: Error - Number:429 Source:Microsoft VBScript runtime error Description:ActiveX component can't create object

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved