deoyagya
asked on
Please help compilC# Excel integration code
Dear Friends,
I am not sure what is wrong with the code at the followijng web address, but the code is not compiling with VS 2008. Can someone pleaese look into this?
The code is located at http://support.microsoft.com/kb/303872.
Appreciate your help,
Thanks,
AMita
I am not sure what is wrong with the code at the followijng web address, but the code is not compiling with VS 2008. Can someone pleaese look into this?
The code is located at http://support.microsoft.com/kb/303872.
Appreciate your help,
Thanks,
AMita
What error message do you get and in what line?
And which edition of VS are you using? I don't think the express edition can use it.
ASKER
I am using Visual Studio 2008. I am getting the error message at the following line of the code:
oCommandBar = oExcel.CommandBars.Add("VB AMacroComm andBar",oM issing, oMissing,\);
This is giving me error related to new line character.
oCommandBar = oExcel.CommandBars.Add("VB
This is giving me error related to new line character.
That's a mal-formed statement - you're passing a backslash as the last parameter, which is not valid.
ASKER
Can you give me the working code then.
Try this:
oCommandBar = oExcel.CommandBars.Add("VB AMacroComm andBar",oM issing, oMissing,);
Sorry I meant,
oCommandBar = oExcel.CommandBars.Add("VBAMacroComm andBar",oM issing, oMissing);
ASKER
I tried this. But this is not working. I am getting the error message "Add method takes three arguments".
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot for the help. This is working fine now.