Automation Error on Mac OS X (launching excel from word)

J

Johnny Eager

I am reposting this message in this group. I hope to find the correct group
for my question:

I have created a VBA macro in Word which extracts data from Word, separates
the data, launchs Excel, opens a template, and populates fields. I have the
process reversed (also written in Word). It works flawlessly in all versions
of compatible versions of Windows Office AND in Mac OS 9.2 (Office 98 and
2001) and in all test versions of Mac OS X.

The problem is that on Mac OS X with Office X (in all of the client's
machines) the program crashes just after Excel is launched and the template
is opened. It just kills Word and leaves Excel Open.

We have tested the program on all versions of Macs from iBook 400 to G3
Tower to G4 PowerBook and G4 Towers.

Here is an example of the Code where it crashes:

====

Set xlApp = CreateObject("Excel.Application")
With xlApp
.Workbooks.Open FileName:=sXLtmp, Editable:=True
.ActiveWorkbook.SaveAs FileName:=sXLdoc
.Visible = True
End With

====

All the variable are fine.
All the programs are updated.
All the permissions are corrected.

Again, it works flawlessly on all versions of Office and on all machine I
use to test. But crashes the clients machines.

Question: I have not tested on a dual processor. Can that make a difference
in Microsoft Automation?

I know the business has a site license, can there be some sort of network
checking that would cause this problem? I have unplugged the network. And it
does open Excel.

I would appreciate some input on this perplexing problems.

Thank you very much,

je
 
J

John McGhie [MVP - Word]

Hi Johnny:

OK, you should have popped this into the Mac XL group. But J.E. Will be
along in a matter of hours to answer it in here regardless. He's our
resident XL Macros expert.

In the meantime, I would be inclined to comment out the .Visible statement,
and maybe to insert an OnTime = Now() + 00:00:05 statement between your
create Object and your With statement.

Yes, there can be a raft of Bad Things happening if Office X is not
installed in Applications folder on the boot partition of a local drive.
Sadly, most of these are difficult to find and require a heap of
work-arounds.

Creating a CarbonLib Registration Database by opening all of the
applications with Office installed on the workstation's local drive and
copying it over the CarbonLib Registration Database for the logged-in user
cures a lot of them. Scan for Corentin's posts yesterday or the day before:
he set out a procedure that tells how to do this in response to another
user's crashing question. Corentin is the other person who is likely to be
able to help you here: he also does heavy-weight development in Office on
the Mac.

Cheers

from said:
I am reposting this message in this group. I hope to find the correct group
for my question:

I have created a VBA macro in Word which extracts data from Word, separates
the data, launchs Excel, opens a template, and populates fields. I have the
process reversed (also written in Word). It works flawlessly in all versions
of compatible versions of Windows Office AND in Mac OS 9.2 (Office 98 and
2001) and in all test versions of Mac OS X.

The problem is that on Mac OS X with Office X (in all of the client's
machines) the program crashes just after Excel is launched and the template
is opened. It just kills Word and leaves Excel Open.

We have tested the program on all versions of Macs from iBook 400 to G3
Tower to G4 PowerBook and G4 Towers.

Here is an example of the Code where it crashes:

====

Set xlApp = CreateObject("Excel.Application")
With xlApp
.Workbooks.Open FileName:=sXLtmp, Editable:=True
.ActiveWorkbook.SaveAs FileName:=sXLdoc
.Visible = True
End With

====

All the variable are fine.
All the programs are updated.
All the permissions are corrected.

Again, it works flawlessly on all versions of Office and on all machine I
use to test. But crashes the clients machines.

Question: I have not tested on a dual processor. Can that make a difference
in Microsoft Automation?

I know the business has a site license, can there be some sort of network
checking that would cause this problem? I have unplugged the network. And it
does open Excel.

I would appreciate some input on this perplexing problems.

Thank you very much,

je

--

Please respond only to the newsgroup to preserve the thread.

John McGhie, Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. GMT + 10 Hrs
+61 4 1209 1410, mailto:[email protected]
 
J

Jim Gordon MVP

Hi Johnny,

I think you are a good detective.

Yes, Excel does check the network to see whether or not it is properly
licensed. If Excel finds another copy using the same product ID it won't
open - the exception being one laptop and one desktop copy can be used.

You should be able to test this easily enough by seeing if Excel will open
on the offending computer without using a Macro.

Let us know how it turns out.

Thanks.

-Jim
 

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