Re: IDispatch::GetIDsOfName() and IDispatch::Invoke() Help

Tech-Archive recommends: Fix windows errors by optimizing your registry



heyji2@xxxxxxxxx wrote:
DISPID id;
LPOLESTR Name=L"Excel";
hr = pDisp->GetIDsOfNames(IID_NULL,&Name,1,LOCALE_USER_DEFAULT,&id);
if(FAILED(hr))
{
// I always get here. I am not sure the Name "Excel" is
correct or what to put here ? "Excel.Application" ,...?
toolStripStatusLabel1->Text = "GetIDsOfNames failed";
}

I'm not sure what this is supposed to achieve. GetIDsOfNames takes a
name of a property or method implemented by the object, and returns a
DISPID suitable for passing to IDispatch::Invoke. Apparently, Excel
Workbook object does not implement a property or method named "Excel"
nor "Excel.Application". Consult the documentation to find out which
properties and methods it does implement.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Re: calling original excel code from access
    ... Your code is using late binding to EXCEL (CreateObject. ... Dim both object variables as Object: ... >> As I recall, Cells is an collection belonging to the Worksheet object, ... >> the Workbook object, which is a member of the Workbooks collection, ...
    (microsoft.public.access.formscoding)
  • Re: Update Excel Spreadsheet from Access Report
    ... SaveAs is a method of the ... Workbook object. ... Since you've only got a single workbook, ... I dont suppose you can help me with the Excel Save as command. ...
    (microsoft.public.access.modulesdaovba)
  • Re: How to catch the window close event in VB6?
    ... I am writing a VB6 app, which can launch a couple different types of files, ... For Excel check out the Workbook_BeforeClose event. ... object also has a Saved property. ... and Workbook object WithEvents ...
    (microsoft.public.vb.general.discussion)
  • Re: IDispatch::GetIDsOfName() and IDispatch::Invoke() Help
    ... DISPID suitable for passing to IDispatch::Invoke. ... Apparently, Excel ... I believe from a file moniker you would get Workbook object, ...
    (microsoft.public.win32.programmer.ole)