LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default "Member Not Found" Error with Excel 2000

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.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
error "Excel has found unreadable Content" JLMHoss Excel Discussion (Misc queries) 10 August 20th 08 03:54 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Compile error: Method or data member not found Brian Day Excel Worksheet Functions 0 July 22nd 07 03:20 AM
Why do I receive "Fill not found" message when I open Excel? dmmahone Setting up and Configuration of Excel 0 March 28th 07 12:03 AM
using % button gives error "percent style not found" Can I reset? Light Excel Discussion (Misc queries) 3 March 16th 06 12:18 PM


All times are GMT +1. The time now is 04:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"