Click here to Skip to main content
16,007,814 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: StrReplace Pin
Archer28220-Jul-04 7:44
Archer28220-Jul-04 7:44 
GeneralSTL map with Boost shared_ptr (attempt 2) Pin
tentons19-Jul-04 16:28
tentons19-Jul-04 16:28 
GeneralSTL map with Boost shared_ptr Pin
tentons19-Jul-04 16:24
tentons19-Jul-04 16:24 
GeneralResource Editor Toolbar Pin
floored19-Jul-04 15:09
floored19-Jul-04 15:09 
GeneralRe: HELP!!! Pin
Antti Keskinen19-Jul-04 14:39
Antti Keskinen19-Jul-04 14:39 
GeneralExcel automation (HELP!!!) Pin
daydremer19-Jul-04 14:34
daydremer19-Jul-04 14:34 
GeneralRe: Excel automation (HELP!!!) Pin
Antti Keskinen19-Jul-04 14:38
Antti Keskinen19-Jul-04 14:38 
GeneralRe: Excel automation (HELP!!!) Pin
daydremer19-Jul-04 15:06
daydremer19-Jul-04 15:06 
I already set the worksheets property accordingly.
I also step through the code in debug mode, but I could not understand the return values of the function, it shift to a different source file.

Here's a sample of my code...

<br />
	//Excel declarations<br />
	_Application	appExcel;<br />
	Workbooks		books;<br />
	_Workbook		book;<br />
	Worksheets		sheets;<br />
	_Worksheet		sheet;<br />
	Range			range;<br />
 	<br />
<br />
	if( !appExcel.CreateDispatch( "Excel.Application" ) )<br />
	{<br />
		AfxMessageBox( "Excel couldn't start." ); //Couldn't start Excel and get Application object.<br />
		return ;<br />
	}<br />
	appExcel.SetVisible( FALSE );<br />
        <br />
        //Setting the Worksheet properties<br />
	COleVariant UpdateLinks( ( long ) TRUE, VT_BOOL ), <br />
		ReadOnly( ( long ) FALSE, VT_BOOL ),<br />
		Format  ( ( long ) TRUE, VT_BOOL ),<br />
		Password( ( long ) FALSE, VT_BOOL ),<br />
		WriteResPassword( ( long ) FALSE, VT_BOOL ),<br />
		IgnoreReadOnlyRecommended( ( long ) FALSE, VT_BOOL ),<br />
		Origin   ( ( short ) 2 ),<br />
		Delimiter( ( long ) FALSE, VT_BOOL ), <br />
		Editable ( ( long ) FALSE, VT_BOOL ), <br />
		Notify   ( ( long ) FALSE, VT_BOOL ), <br />
		Converter( ( long ) FALSE, VT_BOOL ), <br />
		AddToMru ( ( long )  TRUE, VT_BOOL ); <br />
<br />
	books = appExcel.GetWorkbooks( );<br />
	book = books.Open( m_strReportPath, UpdateLinks, ReadOnly, Format, Password, WriteResPassword, <br />
         		IgnoreReadOnlyRecommended, Origin, Delimiter, Editable, Notify, Converter, AddToMru );<br />
<br />
	sheets = book.GetSheets( );<br />
	sheet  = sheets.GetItem( COleVariant( ( short ) 2 ) );<br />
	<br />
	COleVariant vOpt((long)DISP_E_PARAMNOTFOUND, VT_ERROR);<br />
	sheet.Activate( );<br />
	sheets.Copy( COleVariant( (short) 2), COleVariant( (short) 1));<br />
	<br />
	book.Save( );	<br />
	books.Close( );<br />
	appExcel.Quit( );<br />

Generalquestion on use of global scope operator Pin
digwizfox19-Jul-04 14:07
digwizfox19-Jul-04 14:07 
GeneralRe: question on use of global scope operator Pin
Antti Keskinen19-Jul-04 14:20
Antti Keskinen19-Jul-04 14:20 
GeneralRe: question on use of global scope operator Pin
digwizfox19-Jul-04 14:44
digwizfox19-Jul-04 14:44 
GeneralRe: question on use of global scope operator Pin
Bhaskar19-Jul-04 19:32
Bhaskar19-Jul-04 19:32 
GeneralRe: question on use of global scope operator Pin
digwizfox20-Jul-04 12:06
digwizfox20-Jul-04 12:06 
GeneralHooking Pin
gamitech19-Jul-04 12:13
gamitech19-Jul-04 12:13 
GeneralRe: Hooking Pin
User 665819-Jul-04 12:28
User 665819-Jul-04 12:28 
GeneralRe: Hooking Pin
bikram singh19-Jul-04 12:45
bikram singh19-Jul-04 12:45 
GeneralScripting for Game Mods... Pin
mztrjimmy19-Jul-04 12:10
mztrjimmy19-Jul-04 12:10 
GeneralRe: Scripting for Game Mods... Pin
Andrew Walker19-Jul-04 13:56
Andrew Walker19-Jul-04 13:56 
GeneralRe: Scripting for Game Mods... Pin
mztrjimmy19-Jul-04 15:09
mztrjimmy19-Jul-04 15:09 
GeneralDynamically Added Menu Items Greyed Pin
skonopa19-Jul-04 11:20
skonopa19-Jul-04 11:20 
GeneralRe: Dynamically Added Menu Items Greyed Pin
Michael Dunn19-Jul-04 12:10
sitebuilderMichael Dunn19-Jul-04 12:10 
GeneralRe: Dynamically Added Menu Items Greyed Pin
skonopa20-Jul-04 5:15
skonopa20-Jul-04 5:15 
GeneralCurrent Working Directory Pin
alexdevmaster19-Jul-04 11:00
alexdevmaster19-Jul-04 11:00 
GeneralRe: Current Working Directory Pin
vcplusplus19-Jul-04 11:20
vcplusplus19-Jul-04 11:20 
GeneralRe: Current Working Directory Pin
Ivan Cachicatari19-Jul-04 18:07
Ivan Cachicatari19-Jul-04 18:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.