Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default OneColorGradient

hi all,

i have an app that exports excel graphs using "#import excel.h" directive,
now i'm converting the app to use a automation class generated by Microsoft
Studio 6.0 Class Wizard( that has all modules/properties ).

I'm having some trouble converting the line:
series-Fill-OneColorGradient( Office::msoGradientHorizontal, 4, 0.25 );

i have converted to:

#define CovOptionalParam COleVariant((long)DISP_E_PARAMNOTFOUND, VT_ERROR)

SeriesCollection series_collection =
wrkChart.SeriesCollection(CovOptionalParam);
int nSeries = series_collection.GetCount();
for( int iSeries=0; iSeries<nSeries; ++iSeries )
{
Series series_obj = series_collection.Item( _variant_t((short)(iSeries +
1)) );

FillFormat fill_format = series.GetFill();
fill_format.OneColorGradient( msoGradientHorizontal, 4, 0.25 );
}

but it does not work an exception is raised, any ideas?

thanks for all the help
Jose Valente
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default OneColorGradient

solved ;)

using ITypeInfo methods over the GetFill() return interface LPDISPATCH,
i realize that a Series object does not returns an FillFormat interface but
instead it returns an ChartFillFormat:

ChartFillFormat f = series_obj.GetFill();
f.OneColorGradient( msoGradientHorizontal, 4, 0.25 );

does the trick ;)

thanks anyway for all the help
Jose Valente

"Jose Valente" wrote:

hi all,

i have an app that exports excel graphs using "#import excel.h" directive,
now i'm converting the app to use a automation class generated by Microsoft
Studio 6.0 Class Wizard( that has all modules/properties ).

I'm having some trouble converting the line:
series-Fill-OneColorGradient( Office::msoGradientHorizontal, 4, 0.25 );

i have converted to:

#define CovOptionalParam COleVariant((long)DISP_E_PARAMNOTFOUND, VT_ERROR)

SeriesCollection series_collection =
wrkChart.SeriesCollection(CovOptionalParam);
int nSeries = series_collection.GetCount();
for( int iSeries=0; iSeries<nSeries; ++iSeries )
{
Series series_obj = series_collection.Item( _variant_t((short)(iSeries +
1)) );

FillFormat fill_format = series.GetFill();
fill_format.OneColorGradient( msoGradientHorizontal, 4, 0.25 );
}

but it does not work an exception is raised, any ideas?

thanks for all the help
Jose Valente

Reply
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



All times are GMT +1. The time now is 04:14 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"