Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automation of Excel under IE
Message
De
18/11/2004 08:51:26
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
16/11/2004 13:33:13
Tim Muller
Innovative Solutions, Inc.
West New York, New Jersey, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00958541
Message ID:
00962567
Vues:
33
>Cetin--
>
>
>>>My client uses a web site to get some data. When the user asks for the data to be downloaded, a 2nd instance of IE starts with Excel running in it (among other things the Excel menus are different, the menus do not work with the Alt key from the keyboard, etc.). The XLS is sitting on the the web site. Manually the user can save it to the hard drive. If I bring up VFP and put
>>>
>>>
>>>oExcel = GetObject(, "Excel.Application")
>>>WAIT WINDOW oExcel.Range ("A1").value
>>>
>>>
>>>in the Command Window, everything is fine.
>>>
>
>I went the easy way 2 weeks ago. Since I got the above to work, I brought the contents of the XLS into my VFP program cell by cell (slow and dumb, but it worked) and then did what the client needed done to the data.
>
>We deployed to 20+ machines. Worked great except on 2 machines (all machines are Win XP with IE 6 and Excel 2000). On the 2 machines that fail
>
>oExcel = GetObject(, "Excel.Application")
>WAIT WINDOW TYPE ("oExcel.Range")
>
>says that oExcel.Range is undefined (on the other 20 machines it is an object). Any thoughts on what could be going wrong? I have never used Automation on Excel running under IE. Strikes me that life should be different than just using Automation on Excel.
>
>Tim

Tim,
Before the Range itself is oExcel really an accesible object? I don't know what would GetObject() call would return if on those particular computers you're not allowed to automate Excel. It might be returning w/o an error though you're not allowed (typical with Dell computers where Office is preinstalled and automation is not allowed via security).
Test this on those computers:

oExcel = createobject("Excel.Application")
or:
type("oExcel.Application")

I suspect those 2 would return access denied -80004001?- errors. You might fix it:
Start\Run\dcomcnfg
Dblclick:
Component Services
Computers
My Computer
DCOM Config
Locate Microsoft Excel.Application, right click and select properties. Check security and identity tabs.

PS: I suggest not to use GetObject() but createobject().
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform