I tried this,in this case I am getting "hresult hr" as "E_NOINTERFACE".
KTTransfer
Posts
-
Getting COM Error: Scalar deleting destructor. -
Getting COM Error: Scalar deleting destructor.Hi, I am working on Excel Automation. Implemented the logic to retrieve all the running Excel instances, now I am getting IDispatch pointer. Assigning this IDispatch Pointer to Excel object. Following is the code: IDispatch* p=NULL; HRESULT hr = AccessibleObjectFromWindow(hwnd, OBJID_WINDOW, __uuidof(IDispatch), (void**)&p); if(hr == S_OK) { try { Excel::WindowsPtr pWindow = NULL; HRESULT hr = p->QueryInterface(__uuidof(IDispatch),(void**)&pWindow); Excel::_ApplicationPtr xl; xl = pWindow->Application; But getting com exception at above line. The com error: _Vfpointer: scalar deleting destructor(unsigned int) m_hresult:"Member not found". I googled but there is no clarity in solution. If any clue, please let me know. Thanks in Advance. Regards, KTTransfer.
-
Not getting Excel::_ApplicationPtr from WindowsPtr.Hi, I am working on Excel Automation. Implemented the logic to retrieve all the running Excel instances, now I am getting IDispatch pointer. Assigning this IDispatch Pointer to Excel object. Following is the code: IDispatch* p=NULL; HRESULT hr = AccessibleObjectFromWindow(hwnd, OBJID_WINDOW, __uuidof(IDispatch), (void**)&p); if(hr == S_OK) { try { Excel::WindowsPtr pWindow = NULL; HRESULT hr = p->QueryInterface(__uuidof(IDispatch),(void**)&pWindow); Excel::_ApplicationPtr xl; xl = pWindow->Application; But its throwing exception at above line. The com error is: m_hresult is "Member not found". I googled but there is no clarity in solution. If any clue, please let me know. Thanks in Advance. Regards, KTTransfer.
-
How to get all instances of Excel.exeI need COM instance. Excel::_ApplicationPtr.
-
How to get all instances of Excel.exeHi, I am working on Excel Automation Project. using GetActiveobject , getting one instance of Excel.exe. But need to track/access any number of instances which are opened. Initally I am checking all the processes in task manager, if Excel.exe is running, then I will loop through to get the active Excel object using GetActiveObject. But only one instance I am able to access. How to track other instance of Excel.exe's. Regards, KTTransfer.
-
How to Track the event in Excel for cell insert/delete in C++ or VC++ for ?Hi Stuart, Is there any chance to track the "menu" selected by user in Excel Menu Items. If we get this, then we can achieve tracking allignment of data? Regards, KTTransfer.
-
How to Track the event in Excel for cell insert/delete in C++ or VC++ for ?Hi Stuart, When cell is inserted, only cell where the new cell is inserted or deleted will be tracked in sheetchange event. But whereas the allignment of data cannot be tracked. For example: if following is the data before cell insert c0 c1 c2 c3 r0 1 2 3 4 r1 2 3 4 5 r2 3 4 5 6 If say I have inserted cell at r1c1 then the allignment of data after cell insert will be: c0 c1 c2 c3 c4 r0 1 2 3 4 r1 2 * 3 4 5 r2 3 4 5 6 * represents blank cell is inserted. How to track this change in allignment? For above example allignment change data will be:(r1c2:3,r1c3:4,r1c4:5) Following is the code in sheet change: _bstr_t result= target->GetAddress(1,1,Excel::XlReferenceStyle::xlR1C1,1,1); In result we are getting only r1c1. As of now we are able to do it when user inserts the cell using context menu: right click->insert, this we are tracking in sheetbeforerightclick, where we are setting the bool flag , and immediately in sheet change we are checking the same bool flag for true , if it is true then we are reading that complete row and complete col.But this will not work when user inserts/deletes the cell through menu. Please guide us to get this change in allingment of data for all the four options: cell insert/delete(shift cells right, shift cells down)/(shift cells up, shift cells left) when user inserts cell either through context menu or menu. Thanks in Advance, Regards, KTTransfer.
-
Excel.exe is not getting killed implicitlyHi, I am working on Excel automation using VC++(unmanaged). imports: #import "libid:00020813-0000-0000-C000-000000000046" auto_search no_dual_interfaces \ rename("DialogBox", "excelDialogBox") \ rename("RGB", "excelRGB") \ rename("DocumentProperties", "excelDocumentProperties") \ rename("SearchPath", "excelSearchPath") \ rename("CopyFile", "excelCopyFile") \ rename("ReplaceText", "excelReplaceText") Following are the two issues: 1. Whenever Excel is closed , Excel.EXE is not getting closed. My application should track opening and closing of Excel. I released application pointer(Excel::_ApplicationPtr) but same problem. I googled and got few solutions, but nothing worked. I tried : Excel::_ApplicationPtr XL. And getting the active object of excel using GetActiveObject. XL->Quit(); XL->Release(); XL = NULL; but none of these worked. Is there any similar method like Marshal.ReleaseComObject in UNmanaged VC++? 2. Is there any callback which tracks excel.exe is closed? Please give me clue to solve these issues. Regards, KTTransfer.
-
EXCEL.EXE is not getting killedThen instead of #import what else we can use to include? I tried making it visible and then used quit but no use. It's not getting killed.
-
EXCEL.EXE is not getting killedI am working on Excel automation using VC++(unmanaged). Following are the two issues: 1. Whenever Excel is closed , Excel.EXE is not getting closed. My application should track opening and closing of Excel. I released application pointer(Excel::_ApplicationPtr) but same problem. I googled and got few solutions, but nothing worked. I tried : Excel::_ApplicationPtr XL. XL->Quit(); XL->Release(); XL = NULL; but none of these worked. 2. Is there any callback which tracks excel.exe is closed? Please give me clue to solve these issues. Regards, KTTransfer.
-
AfterCalculate is missing in Excel.tli, version: Office 2003No its not working. AfterCalculate event is introduced in office 2007. So its not available in 2003. But is there any way to get it by including any thing in application which works for both the versions. If any idea.. . Thanks in advance. Regards, KTTransfer.
-
AfterCalculate is missing in Excel.tli, version: Office 2003I am working on Excel Automation. Application is MFC application without GUI. All callbacks work perfectly in machine where office version is 2007 but same is not working in 2003. When checking Excel.tli or tlh in both the machines, the size is different and AfterCalculate call back is missing in tli and tlh. What needs to be added to application, to make it work for both versions. This is how I imported: #import "libid:00020813-0000-0000-C000-000000000046" auto_search no_dual_interfaces \ rename("DialogBox", "excelDialogBox") \ rename("RGB", "excelRGB") \ rename("DocumentProperties", "excelDocumentProperties") \ rename("SearchPath", "excelSearchPath") \ rename("CopyFile", "excelCopyFile") \ rename("ReplaceText", "excelReplaceText") Please give me clue. Regards, KTTransfer.
-
Invoking exe from windows service(COM Exe runs as service)I want to invoke exe(MFC without GUI) from windows service(COM Exe runs as service). I am using CreateProcessAsUser and trying to invoke, it invokes(when it invokes i am writing log) but not visible in taskmanager. I doubt that the exe is getting invoked under "SYSTEM" and that is the reason its not visible in taskmanager and nor it works(obvious). But I want to invoke under "User"(who is logged in). To do so I tried using LogonUser but it needs username and password of user who is logged in machine. That I cant access. Please guide me or give me clue. Requirement is: Exe should run under the user who is logged in. Regards, KTTransfer.
-
Issue: adding functions to existing COM EXE [modified]I have added two functions to existing COM EXE which runs as Service. But while calling those functions from another application I am getting unhandled exception like: Unhandled exception at 0x00000000 in xxx.exe: 0xC0000005: Access violation. Existing functions are getting called but only new functions are not working. I have added functions to xxx.idl and implemented in another application by including the header generated after building. I am trying to unregister old COM EXE but its not. Please give me clue to sort out the issue. I am new to COM, please let me know any further info is required to look in this issue. Regards, KTTransfer.
modified on Monday, November 2, 2009 5:26 AM
-
How to set the rule "Do not start new instance" in Task scheduler's settings using command lineHi David, Thank you , it helped me a lot. One more Query I have: 1st Case: How to make task readonly , I mean user should not modify or delete the particular task in "Task Scheduler" and I want to do this setting using command line. Is there any way? (OR) 2nd Case: I want to check all the tasks in task scheduler, if particular task is not created or deleted by user then I will create one. To check all the tasks present in Task Scheduler, I need to check for OS version and depending upon the OS, path of task scheduler(where tasks are created) will change like: Windows vista: dir /b “%SystemRoot%\system32\Tasks” Windows server 2003: dir /b “%SystemRoot%\Tasks” Windows XP: dir /b “%SystemRoot%\Tasks” Is there any predefined way to do or I need to follow one of the above cases. If you have any clue to implement please let me know. Thanks in advance. Regards, KTTransfer.
-
changing the setting of task in task scheduler using command lineHi, OS: Windows Vista As of now I am trying in vista, but same thing i will try in all other microsoft OS. I have created the scheduled task through command line to invoke one exe. Now I want to make that schedule run my exe only once, i mean only instance should run. If there are no instances then it should start one. In task scheduler, for task properties, in settings tab i have "if the task is already running, then the following rule applied" option, where i can set "Do not start a new instance". I want to set the rule in Task Scheduler's settings as "Do not start a new instance". But through command line how to set the same. Thanks in advnace. Regards, KTTransfer.
-
How to set the rule "Do not start new instance" in Task scheduler's settings using command lineHi, OS: Windows Vista I have created the scheduled task through command line to invoke one exe. Now I want to make that schedule run my exe only once, i mean only instance should run. If there are no instances then it should start one. In task scheduler, for task properties, in settings tab i have "if the task is already running, then the following rule applied" option, where i can set "Do not start a new instance". I want to set the rule in Task Scheduler's settings as "Do not start a new instance". But through command line how to set the same. Thanks in advnace. Regards, KTTransfer.
-
Getting the running instance from PID using COMhttp://support.microsoft.com/default.aspx/kb/238975 In above site(as suggested by superman) ,it is clearly written that EXCEL registers only one instance of EXCEL.EXE in ROT. The other instance can only be retrieved if names of workbooks are known. Even in the same site, it is mentioned that for multiple instance refer the site: http://support.microsoft.com/kb/190985 But as per my requirement I need to track all excel.exe's running in processes using MFC(No gui, only exe)application but not setting anything in EXCEL as mentioned in above site. If you get any clue from above mentioned sites, please let me know. Thanks in advance. Regards, KTTransfer
-
Getting the running instance from PID using COMHey I tried all the ways but.....no Aim: To attach all the multiple processes of EXCEL.EXE's running in taskmanager and reading all sheets and workbooks using EXCEL automation. But using EXCEL automation only one instance of EXCEL we can connect using GetActiveObject. In above case only active instance is retrieved and even EXCEL.exe which is opened first is retrieved.But want to retrieve all workbooks and sheets in the running instances of EXCEL.EXE. Only way to differentiate between two EXCEL.EXE's running in taskmanager is PID. So want to connect the EXCEL instance using PID and then retrieving the workbooks and worksheets. IS there any way to get it, please give me clue. Thanks in Advance. Regards, KTTransfer.
-
Getting the running instance from PID using COMIs there any way to get the instance of EXCEL.EXE from Process ID using COM? Similar to GetActiveObject, is there any other thing through which we can get the instances of multiple EXCEL.EXE running in Task Manager? After getting handle to each EXCEL.EXE, I want to track all workbooks and sheets. I am using EXCEL automation to do this using C++. Getting all workbooks and sheets is done. But after getting PID of EXCEL.exe's , how to get that object? I am getting PID for each process using psapi.h. I think I am not asking a question, which I am not supposed to or I shouldn't ask.:confused::~ In C#.net we have BinkToMoniker to get the object. Is there any such thing in C++(unmanaged). Thanks in advance. Regards, KTT