Controlling Reflection1 from Excel using getObject

  • Thread starter Thread starter Michael Nisgore
  • Start date Start date
M

Michael Nisgore

I know that a person can use Reflection to control Excel, but I'd
rather work from within Excel to control an already existing
Reflection1.session object. Does anyone know how to do this??????

To date I've figured this much out...
** Use getObject to access an existing object...

problem is, I don't know how to reference the active Reflection window
that has the data I want and I can't set up a new Reflection session
because it has to be set up remotely. When I use getObject I either
get an error or it opens a new Reflection.session that is useless to
me.

any advice about how to find and return an active object to getObject
would be much appreciated...

thanks,
Mike
 
It's like accessing any VBA-compliant object. I use Reflection at work,
and was overjoyed to learn that it has a VBA object model that I can
control from Excel. Now if I can only get time to write some code to run
it...

Set a reference to the Reflection object library (in the VB Editor, go
to Tools > References, and scroll around until you find it). This will
give you Intellisense when you type AppReflect and a period, and will
allow you to probe the Reflection object model in the Object Browser.

Here is the beginning of the code that opens a new instance of
Reflection2. (This is an old version of reflection, dating from 1996.
Even the Excel 97 they have me using is more modern. But the code is
still valid.)

Sub UseReflection()
Dim AppReflect As Reflection2.Application

Set AppReflect = CreateObject("Reflection2.Application")
With AppReflect
.Visible = True
.ProcessDataComm = False
.Transmit CR
.ConnectionType = "BEST-NETWORK"
.ConnectionSettings = "Host 204.155.111.3"
.ConnectionSettings = "DefaultNetwork TELNET"
.Connect

' etc
End With

- Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top