N
Nicolas
Hi,
I want to do the following with automation :
* Get a cell that is containing a formula (let's call it A1).
* Resize the range to be 5 by 5
* Enter a new formula in A1 that will be an array function and output in the
new range.
I did the following :
try
{
lpDisp= m_pExcelApplication.GetActiveSheet();
_Worksheet workSheet;
workSheet.AttachDispatch(lpDisp);
lpDisp = workSheet.GetRange(COleVariant("B4"),
COleVariant("B4"));
Range range;
range.AttachDispatch(lpDisp);
range.SetValue(COleVariant("asdf"));
}
catch (COleDispatchException *e)
{
char buf[1024]; // For the Try...Catch error message.
sprintf(buf,"COleDispatchException. SCODE: %08lx, Description:
\"%s\".",(long)e->m_wCode,(LPSTR)e->m_strDescription.GetBuffer(512));
::MessageBox(NULL, buf, "COleDispatchException",
MB_SETFOREGROUND | MB_OK);
}
But it doesn't work.
I always get a "COleDispatchException" with SCODE of 00000000
class" error.
Can anybody help me?
Thanks
Nic
I want to do the following with automation :
* Get a cell that is containing a formula (let's call it A1).
* Resize the range to be 5 by 5
* Enter a new formula in A1 that will be an array function and output in the
new range.
I did the following :
try
{
lpDisp= m_pExcelApplication.GetActiveSheet();
_Worksheet workSheet;
workSheet.AttachDispatch(lpDisp);
lpDisp = workSheet.GetRange(COleVariant("B4"),
COleVariant("B4"));
Range range;
range.AttachDispatch(lpDisp);
range.SetValue(COleVariant("asdf"));
}
catch (COleDispatchException *e)
{
char buf[1024]; // For the Try...Catch error message.
sprintf(buf,"COleDispatchException. SCODE: %08lx, Description:
\"%s\".",(long)e->m_wCode,(LPSTR)e->m_strDescription.GetBuffer(512));
::MessageBox(NULL, buf, "COleDispatchException",
MB_SETFOREGROUND | MB_OK);
}
But it doesn't work.
I always get a "COleDispatchException" with SCODE of 00000000
class" error.
Can anybody help me?
Thanks
Nic