com

PHP fails to open an Excel workbook through COM

独自空忆成欢 提交于 2019-12-11 07:43:19
问题 This code works fine until it gets to the open workbook line and then it fails. <?PHP $file = "C:\\xampp\\htdocs\\php\\test.xls"; openWorkbook($file); function openWorkbook($file) { $excel = new COM("Excel.Application") or die ("ERROR: Unable to instantaniate COM!\r\n"); echo "Application name: {$excel->Application->value}\r\n"; echo "Loaded version: {$excel->Application->version}\r\n"; // FAILS ON THIS LINE! $Workbook = $excel->Workbooks->Open($file) or die("ERROR: Unable to open " . $file .

Can not reference a Dll that worked earlier

自闭症网瘾萝莉.ら 提交于 2019-12-11 07:38:14
问题 I am trying to change the Terminal Services settings programmaticly. I learned that you must use tsuserex.dll. Being c# i ran tsuserex through tlbimp and created TSUSEREXLib.dll then registered it with regasm. I got it working and wrote a framework program with it as a prof of concept. However today after I made some changes when I run my program I get the error Unable to cast COM object of type 'System.__ComObject' to interface type 'TSUSEREXLib.IADsTSUserEx'. This operation failed because

Create Excel Add-in without VSTO

拈花ヽ惹草 提交于 2019-12-11 07:32:49
问题 I have used VS 2010 to create an Excel 2007 Add-in with C#. The add-in is a TaskPane-based UI. Works great, love it. However, my users do not have Admin access and cannot install the add-in because VSTO is required. Is there a way to create/port this add-in to a normal COM based add-in without this show-stopping reference to VSTO? 回答1: They shouldn't necessarily require admin rights just because you use vsto. Make sure that the addin is being installed "Per user" instead of "per machine". 回答2

Use Com class from LocalSystem

折月煮酒 提交于 2019-12-11 07:29:13
问题 I'm using a Com object. The com server should be used from a Windows service running as a specific account. But when running in this account it can't load the com, giving me this exception: Creating an instance of the COM component with CLSID {36998A63-857C-4B87-BC5E-72B7B3573F80} from the IClassFactory failed due to the following error: 80010105. I tried changing the account to LocalSystem, that still fails, but changing the Windows service to log on as my own account works. I guess it has

Word Add-in keeps Word process alive when document is embedded via OLE

有些话、适合烂在心里 提交于 2019-12-11 07:16:56
问题 I have built a Word Add-in which has to do a task when the user closes the document. I installed an event handler for the DocumentBeforeClose event of the Application object to do that. The problem is that the event handler appears to prevent the Word process from exiting when I embed an existing Word document in an Excel workbook for example. The problem occurs when I embed the document in Excel via the Ribbon Insert > Object > Create from File and then select a Word document. The document

How to reuse a (Delphi) OLE server with a second client?

ぃ、小莉子 提交于 2019-12-11 06:58:12
问题 I wrote an OLE automation server (using Delphi). I usually start the OLE server manually and use it as a normal application. From time to time I start a client, which automatically connect to the existing OLE Server. When I terminate the client, the server does not terminate (at least when it was started manually before the client) but it won't accept any other OLE connection. Starting another client will trigger a new server instead of reusing the first one. How can I reuse the same server

Run Access Queries via Interop?

大城市里の小女人 提交于 2019-12-11 06:56:07
问题 I have a few MS-Access queries in several *.mdb files. They are quite complex. So I just want to open a file, run specific queries which it contains and get a resulting table back. How can I do that ? (I know we can just connect via connection string etc. but I want to explore this way.) My sample code (edited to disable security alerts): using Microsoft.Office.Interop.Access; using Microsoft.Office.Core; var app = new Application(); app.OpenCurrentDatabase(@"C:\test.mdb", true); app

how can i read cookie generated by web browser from activex control

风格不统一 提交于 2019-12-11 06:48:31
问题 I want to read and fetch the contents of a cookie generated by web browser from activex control. I dont want to read the cookie from javascript and pass it to activex control. I want read the cookie directly from activex control. If it is possible then suggest me the APIs for that and also same thing I have to achieve using NPAPI also (so please suggest APIs in here also). So looking forward for some positive answers. 回答1: What you can do is 1) hook up Web Browser events, using for example

Why is my COM object not displaying methods in Component Services?

谁说我不能喝 提交于 2019-12-11 06:41:55
问题 I am trying to create a COM object and register it under COM+. Everything seems to go well, but when I look in Component Services and drill down through Console Root | Component Services | Computers | My Computer | COM+ Applications | TestCom | Components | TestCom.Com.MyCom | Interfaces | _MyCom | Methods I do not see my method listed. In my project properties I have signed my assembly. AssemblyInfo.cs: [assembly: ApplicationName("TestCom")] [assembly: ApplicationAccessControl(false)]

Debugging PHP error on IIS (as it relates to calling com objects)

♀尐吖头ヾ 提交于 2019-12-11 06:31:57
问题 This question is related to another question I wrote: Trouble using DOTNET from PHP. Where I was using the DOTNET() function in PHP to call a DLL I had written. I was able to get it working fine by running php.exe example.php from the command line (with the DLL's still in the PHP folder). I moved the php file to an IIS 7 webserver folder on the same machine (leaving the DLLs in the same php folder), but I keep getting a 500 internal service error . I've checked the server logs (in c:\inetput