"Member Not Found" Error with Excel 2000

P

Paul

Hello,

I have been trying to write a program that works with Excel and have
been rather successful. However, I was writing the program under WinXP
and OfficeXP.. the program is meant to run under Win2000 and
Office2000.

My program runs fine on my computer (XP) but gives the "Member Not
Found" error on the Win2K computer.

Let me show you my code:
//the pointof the following function is to open an Excel file
//and make it visible to the user.
void CSresult::OnButtonExcel()
{
boxindex = m_result_box.GetCurSel ();
CString filestring =
myvector[indexoffound[boxindex]].filepath; filestring.Replace('*', '
');
if (boxindex!=-1 && resultvector[0]!=CString("No Matches Found") &&
filestring!=CString("UNKNOWN")) //not wrapped in actual program
{
COleVariant VOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
_Application objApp;
_Workbook objBook;
Workbooks objBooks;

objApp.CreateDispatch("Excel.Application");
objBooks = objApp.GetWorkbooks();
objApp.SetVisible(TRUE);
/*OK, the following call is what causes the error(of course, it's not
wrapped in the actual program)*/
objBooks.Open(filestring,
VOptional, VOptional, VOptional, VOptional,
VOptional, VOptional, VOptional, VOptional,
VOptional, VOptional, VOptional,
VOptional,VOptional,VOptional);

/* objApp.FindFile();
objApp.GetActiveWorkbook();
The above two lines would work but the user would have to select the
file -- not the wanted outcome
*/

AfxMessageBox ("Click OK When You Are Done With Excel File");
objBook.Close(COleVariant((short)FALSE), VOptional, VOptional);
objApp.Quit();
}
else
AfxMessageBox ("One of the following happened:\n1. There is no Excel
file associated with this entry.\n2. You have not made a
selection.\n3. Your search yielded no results.");

}

Any idea what could cause this error?

I thank you in advance,
Sincerely,

Paul.
(e-mail address removed)
 
B

Bill Li

Hello Paul,

Maybe the XP library is different from the 2000 library.
Try to re-link the missing library or change the function
in XP library but not in 2000 library.

Best Regards

Bill
-----Original Message-----
Hello,

I have been trying to write a program that works with Excel and have
been rather successful. However, I was writing the program under WinXP
and OfficeXP.. the program is meant to run under Win2000 and
Office2000.

My program runs fine on my computer (XP) but gives the "Member Not
Found" error on the Win2K computer.

Let me show you my code:
//the pointof the following function is to open an Excel file
//and make it visible to the user.
void CSresult::OnButtonExcel()
{
boxindex = m_result_box.GetCurSel ();
CString filestring =
myvector[indexoffound[boxindex]].filepath; filestring.Replace('*', '
');
if (boxindex!=-1 && resultvector[0]!=CString("No Matches Found") &&
filestring!=CString("UNKNOWN")) //not wrapped in actual program
{
COleVariant VOptional((long)
DISP_E_PARAMNOTFOUND, VT_ERROR);
_Application objApp;
_Workbook objBook;
Workbooks objBooks;

objApp.CreateDispatch("Excel.Application");
objBooks = objApp.GetWorkbooks();
objApp.SetVisible(TRUE);
/*OK, the following call is what causes the error(of course, it's not
wrapped in the actual program)*/
objBooks.Open(filestring,
VOptional, VOptional, VOptional, VOptional,
VOptional, VOptional, VOptional, VOptional,
VOptional, VOptional, VOptional,
VOptional,VOptional,VOptional);

/* objApp.FindFile();
objApp.GetActiveWorkbook();
The above two lines would work but the user would have to select the
file -- not the wanted outcome
*/

AfxMessageBox ("Click OK When You Are Done With Excel File");
objBook.Close(COleVariant((short)FALSE), VOptional, VOptional);
objApp.Quit();
}
else
AfxMessageBox ("One of the following
happened:\n1. There is no Excel
 
P

Paul

Bill,

I understand that this indeed is the issue at hand... however, I don't
have the Win2K library available and I don't know how to change the
function -- the Workbooks::Open (...) function calls another function
called InvokeHelper (...) and that's when the error occurs. I can't
find the definition for this function. I don't know what to do!!!

Thank you,

Paul.

Bill Li said:
Hello Paul,

Maybe the XP library is different from the 2000 library.
Try to re-link the missing library or change the function
in XP library but not in 2000 library.

Best Regards

Bill
-----Original Message-----
Hello,

I have been trying to write a program that works with Excel and have
been rather successful. However, I was writing the program under WinXP
and OfficeXP.. the program is meant to run under Win2000 and
Office2000.

My program runs fine on my computer (XP) but gives the "Member Not
Found" error on the Win2K computer.

Let me show you my code:
//the pointof the following function is to open an Excel file
//and make it visible to the user.
void CSresult::OnButtonExcel()
{
boxindex = m_result_box.GetCurSel ();
CString filestring =
myvector[indexoffound[boxindex]].filepath; filestring.Replace('*', '
');
if (boxindex!=-1 && resultvector[0]!=CString("No Matches Found") &&
filestring!=CString("UNKNOWN")) //not wrapped in actual program
{
COleVariant VOptional((long)
DISP_E_PARAMNOTFOUND, VT_ERROR);
_Application objApp;
_Workbook objBook;
Workbooks objBooks;

objApp.CreateDispatch("Excel.Application");
objBooks = objApp.GetWorkbooks();
objApp.SetVisible(TRUE);
/*OK, the following call is what causes the error(of course, it's not
wrapped in the actual program)*/
objBooks.Open(filestring,
VOptional, VOptional, VOptional, VOptional,
VOptional, VOptional, VOptional, VOptional,
VOptional, VOptional, VOptional,
VOptional,VOptional,VOptional);

/* objApp.FindFile();
objApp.GetActiveWorkbook();
The above two lines would work but the user would have to select the
file -- not the wanted outcome
*/

AfxMessageBox ("Click OK When You Are Done With Excel File");
objBook.Close(COleVariant((short)FALSE), VOptional, VOptional);
objApp.Quit();
}
else
AfxMessageBox ("One of the following
happened:\n1. There is no Excel
file associated with this entry.\n2. You have not made a
selection.\n3. Your search yielded no results.");

}

Any idea what could cause this error?

I thank you in advance,
Sincerely,

Paul.
(e-mail address removed)
.
 

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