怎么设置Excel文件中线段的颜色
如何设置Excel文件中线段的颜色
#define COLOR_RED 0x0000ff
如何把COLOR_RED转化为LPDISPATCH 形式,定义Excel文件中的线段颜色
Shape shapeline;
shapeline=shape.AddLine(start_x,start_y,end_x,end_y);
line.SetBackColor(LPDISPATCH newValue); //???
以下代码编译通过,但运行错误
LPDISPATCH cor;
cor=line.GetBackColor();
// cor=(LPDISPATCH)(_variant_t((long)COLOR_RED));
line.SetBackColor(cor);
------解决方案--------------------
我没弄过Excel
你把那个SetBackColor的原型贴出来看看
还有你看看是不是有什么相关接口有COLOR属性的。
比如说IColor接口、IRbgColor接口之类的啊。因为这样的接口就可以转换成LPDISPATCH。
------解决方案--------------------
VBA编程,看看msdn上的帮助吧。
没有搞过
------解决方案--------------------
可以直接定义COLORREF来设置颜色去使用
STDMETHODIMP SetBackColor( long Value );
Parameters
Value
[in] Background color. This parameter can be one of the following. Value Meaning
A COLORREF value. An RGB color.
A value returned by PALETTEINDEX A palette index.
tomUndefined No change.
tomAutoColor Use the default background color.
If Value contains an RGB color, generate the COLORREF by using the RGB macro.
Return Value
If SetBackColor succeeds, it returns S_OK. If the method fails, it returns one of the following Component Object Model (COM) error codes. For more information about COM error codes, see Error Handling.
E_INVALIDARG Invalid argument.
CO_E_RELEASED The font object is attached to a range that has been deleted.
E_ACCESSDENIED Write access is denied.
E_OUTOFMEMORY Insufficient memory.
------解决方案--------------------
如何设置Excel文件中线段的颜色
线段是什么,是不是表格的线的颜色?还是其它的/?
EXCEL的操作我做过点。接口的参数设置确实比较烦。
我一般是用EXCEL里做一个,再写程序去读出值,再来设。哈。你试试看。爽。
#define COLOR_RED 0x0000ff
如何把COLOR_RED转化为LPDISPATCH 形式,定义Excel文件中的线段颜色
Shape shapeline;
shapeline=shape.AddLine(start_x,start_y,end_x,end_y);
line.SetBackColor(LPDISPATCH newValue); //???
以下代码编译通过,但运行错误
LPDISPATCH cor;
cor=line.GetBackColor();
// cor=(LPDISPATCH)(_variant_t((long)COLOR_RED));
line.SetBackColor(cor);
------解决方案--------------------
我没弄过Excel
你把那个SetBackColor的原型贴出来看看
还有你看看是不是有什么相关接口有COLOR属性的。
比如说IColor接口、IRbgColor接口之类的啊。因为这样的接口就可以转换成LPDISPATCH。
------解决方案--------------------
VBA编程,看看msdn上的帮助吧。
没有搞过
------解决方案--------------------
可以直接定义COLORREF来设置颜色去使用
STDMETHODIMP SetBackColor( long Value );
Parameters
Value
[in] Background color. This parameter can be one of the following. Value Meaning
A COLORREF value. An RGB color.
A value returned by PALETTEINDEX A palette index.
tomUndefined No change.
tomAutoColor Use the default background color.
If Value contains an RGB color, generate the COLORREF by using the RGB macro.
Return Value
If SetBackColor succeeds, it returns S_OK. If the method fails, it returns one of the following Component Object Model (COM) error codes. For more information about COM error codes, see Error Handling.
E_INVALIDARG Invalid argument.
CO_E_RELEASED The font object is attached to a range that has been deleted.
E_ACCESSDENIED Write access is denied.
E_OUTOFMEMORY Insufficient memory.
------解决方案--------------------
如何设置Excel文件中线段的颜色
线段是什么,是不是表格的线的颜色?还是其它的/?
EXCEL的操作我做过点。接口的参数设置确实比较烦。
我一般是用EXCEL里做一个,再写程序去读出值,再来设。哈。你试试看。爽。