ole-automation

Programmatic Execution Excel Macro on Remote Machine from a website

℡╲_俬逩灬. 提交于 2019-12-09 23:54:09
问题 I have a website where users generate an Excel report using a macro, when I try to run it in my local machine it generates perfectly and runs the macro inside Excel. When I publish it into the server and at the same time I am logged in there (RDP open session) and try to run it from a browser outside that server it is also running as expected. The problem occurs when I am logged off in the server (RDP) then run it in a browser outside the server (ie from my machine) the macro does not run but

Register a proxy/stub in HKEY_CURRENT_USER

瘦欲@ 提交于 2019-12-06 04:28:42
The MIDL compiler generates code for a proxy/stub with registration routines that write to HKEY_LOCAL_MACHINE. Is there any way (preferably without hacking the MIDL-generated code and without bypassing all that generated code in favor of custom code) to register a MIDL-generated p/s in HKEY_CURRENT_USER? Also: Will this work if both the p/s and the COM server are registered per-user like this? I just found (after a very frustrating 48 hours) that a p/s registered machine-wide will not work correctly if the COM server is registered per-user. Specifically, the asynchronous call logic

Programmatic Execution Excel Macro on Remote Machine from a website

随声附和 提交于 2019-12-04 19:53:52
I have a website where users generate an Excel report using a macro, when I try to run it in my local machine it generates perfectly and runs the macro inside Excel. When I publish it into the server and at the same time I am logged in there (RDP open session) and try to run it from a browser outside that server it is also running as expected. The problem occurs when I am logged off in the server (RDP) then run it in a browser outside the server (ie from my machine) the macro does not run but creates my Excel. This is the code that I am using public class Report { protected Workbook Workbook {

From C#, open an arbitrary application

情到浓时终转凉″ 提交于 2019-12-04 11:30:53
Related question [stackoverflow] here . I'm trying to do the above, but I want to take the process one step further. I want to open an arbitrary file using the default editor for the file type. From that point, I want to allow my user to interact with the file as they would normally, or continue to work in my application. The extension is what happens after the user finishes editing. Is there a way I can capture a close (and ideally save) event from the external application and use that as a trigger to do something else? For my purposes, tracking the closing of the external application would

What does the Excel range.Rows property really do?

眉间皱痕 提交于 2019-12-03 02:10:05
问题 OK, I am finishing up an add-on project for a legacy Excel-VBA application, and I have once again run up against the conundrum of the mysterious range.Rows (?) and worksheet.Rows properties. Does anyone know what these properties really do and what they are supposed to provide to me? (Note: all of this probably applies to the corresponding *.Columns properties also). What I would really like to be able to use it for is to return a range of rows, like this: SET rng = wks.Rows(iStartRow,

Is there OLE Automation in Java?

风格不统一 提交于 2019-12-01 16:29:53
Is it possible to use OLE Automation in Java? If not, why is it not possible in Java? I'm looking to automate the exporting of excel spreadsheets in different format (ie, .csv etc...) Thanks for the answers in advance :) Perception You can use JACOB . But there will be some pain involved as it's not documented very well and the performance is not the best. It can also be hard to get it running correctly for you environment depending on which version of Windows you are targetting. I would definitely not use it if you are building a scalable web application. Another option would be Apache POI

Is there OLE Automation in Java?

半城伤御伤魂 提交于 2019-12-01 15:26:49
问题 Is it possible to use OLE Automation in Java? If not, why is it not possible in Java? I'm looking to automate the exporting of excel spreadsheets in different format (ie, .csv etc...) Thanks for the answers in advance :) 回答1: You can use JACOB. But there will be some pain involved as it's not documented very well and the performance is not the best. It can also be hard to get it running correctly for you environment depending on which version of Windows you are targetting. I would definitely

OLE Automation to launch MS Word and bring to front

岁酱吖の 提交于 2019-11-30 09:25:11
问题 What is the "correct" (recommended) method for connecting to a running instance of MS Word and bringing this application to the front? I am doing something like the following from a VBA app: ... objWord = GetObject ("Word.Application") if (objWord is nothing) then objWord = CreateObject("Word.Application") end if objWord.Activate() objWord.Visible = true objWord.WindowState = 1 'maximized ... Running on Windows XP with Word 2007, this works most of the time - but periodically, fails to bring

OLE Automation to launch MS Word and bring to front

孤街醉人 提交于 2019-11-29 15:29:57
What is the "correct" (recommended) method for connecting to a running instance of MS Word and bringing this application to the front? I am doing something like the following from a VBA app: ... objWord = GetObject ("Word.Application") if (objWord is nothing) then objWord = CreateObject("Word.Application") end if objWord.Activate() objWord.Visible = true objWord.WindowState = 1 'maximized ... Running on Windows XP with Word 2007, this works most of the time - but periodically, fails to bring the Word window to the front (and instead flashes the minimized icon for Word in the task bar). NOTE :

.NET DateTime, different resolution when converting to and from OADate?

余生长醉 提交于 2019-11-28 11:19:37
I'm converting a DateTime to OADate. I was expecting to get the exact same DateTime when converting the OADate back, but now it has only millisecond resolution, and is therefore different. var a = DateTime.UtcNow; double oadate = a.ToOADate(); var b = DateTime.FromOADate(oadate); int compare = DateTime.Compare(a, b); //Compare is not 0; the date times are not the same Ticks from a: 634202170964319073 Ticks from b: 634202170964310000 The OADate double: 40437.290467951389 What is the reason for this? The resolution of DateTime is clearly good enough. The static method called by ToOADate clearly