Writing Excel Addin

S

Sankalp

Hi,


Is the Excel programming model same as that of Word(apart from the differing
object)?


CComQIPtr <Excel::Application> m_pXLApp;
// Unable to do the following in excel
// compile error ('get_CommandBars' : is not a member of of
'ATL_NoAddRefReleaseOnCComPtr......
......
HRESULT hr = m_pXLApp->get_CommandBars(&spCmdBars);
////////////////////////////////
/// following works in Word
CComPtr<Word::_Application> m_pWordApp;
HRESULT hr = m_pWordApp->get_CommandBars(&pCmdBars);


Am I missing something here?

Could some one point me to some excel addin resources in VC++ and ATL?



Thanks,
Sankalp
 
D

dotnet-force

Hi all,

I'm writing an add-in for MS Project 2002 in C#
I have a opened project in MS Project and I want to save it to a
different name in a callback of one button in my toolbar.

Microsoft.Office.Interop.MSProject.Application appli = ...
string newName = @"C:\tmp\file1.mpp";
appli.FileSaveAs(newName,
Microsoft.Office.Interop.PjFileFormat.pjMPP,
null, // Backup
null, // Readonly
null, // TaskInformation
null, // Filtered
null, // Table
null, // UserID
null, // DatabasePassWord
null, // FormatID
null, // Map
null, // PassWord
null, // WriteResPassword
null, // ClearBaseline
null, // ClearActuals
null, // ClearResourceRates
null, // ClearFixedCosts
null, // XMLName
null);

But with this code, an System.Runtime.InteropServices.COMException
exception is thrown : The argument value is not valid.

Could someone tell me what I am doing wrong ?

Regards,

Pascal Lenormand
ILOG
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top