Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
error "Excel has found unreadable Content" | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Compile error: Method or data member not found | Excel Worksheet Functions | |||
Why do I receive "Fill not found" message when I open Excel? | Setting up and Configuration of Excel | |||
using % button gives error "percent style not found" Can I reset? | Excel Discussion (Misc queries) |