Multiuse (Single Instance) or Single Use (Multiple Instances)

J

Jayashree Krishna

Hi,

Some of our VBA application that used createObject doesn't work . Then we
found about the below points from Microsoft and made it to work using
getObject.
"COM servers can be classified as Multiuse (Single Instance) or Single Use
(Multiple Instances), depending on the number of instances of that server
that can run simultaneously on a single computer. "

We haven't changed anything in the OS, except upgrading Excel 2003 to Excel
2007.Can you let me know what might have made the system to switch from
Single Use (Multiple Instances) to Multiuse (Single Instance)
automatically ? Is there any software or property to make the system Single
Use (Multiple Instances) or Multiuse (Single Instance)

Thanks,
Krishna
 
P

Peter T

Nothing has changed as regards instancing with Excel 2007. Try this in any
app that supports VB/A, even Excel

Sub test()
Dim i As Long
Dim objXL As Object

For i = 1 To 3
Set objXL = CreateObject("excel.application")

With objXL
.WindowState = -4143 ' xlNormal
.Left = i * 50
.Top = i * 50
.workbooks.Add
.Visible = True
End With
Next

End Sub
Some of our VBA application that used createObject doesn't work

Describe what you mean by "doesn't work"

Regards,
Peter T
 
J

Jayashree Krishna

Sorry for the delayed reply peter.
I ran the code that you sent as an Excel VBA .I got the error "Microsoft
excel encountered problem and need to close..."

On using createObject inside VBA , the excel application freezes and close.
I know the reason is because of the Multiuse (Single Instance) or Single Use
(Multiple Instances). I want to know what has changed the system ,that had
earlier allowed to create many instances of excel, to restrict using only one
ionstance. Multiuse (Single Instance)
Thanks,
Krishna
 
P

Peter T

I don't know why you are getting that error, normally there shouldn't be any
problem to run that code with any version of Excel installed. It worked
fine for me with 2007.

However, as I mentioned before, nothing has changed as regards instancing
with Excel 2007 vs earlier versions.

Regards,
Peter T
 

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

Top