我想將excel文檔中sheet1中的某一個儲存格設為紅色,我用對excel文檔的automation方法去
調用用excel9.olb里面的Font類,它的顏色設置參數紅色應如何設置?
程式如下:
Font newfont;
lpDisp=range.GetFont(); newfont.AttachDispatch(lpDisp);
// newfont.Attach(lpDisp);
newfont.SetName(COleVariant("Arial Black"));
newfont.SetSize(COleVariant((long)12));
VARIANT newValue;
newValue=newfont.GetBackground();
// newValue=newfont.GetColorIndex(); // newfont.SetColor(const VARIANT &newValue);
newfont.SetColor(newValue);
這個程式有問題,newValue的值我應設為多少才是紅色呢?
謝謝!
調用用excel9.olb里面的Font類,它的顏色設置參數紅色應如何設置?
程式如下:
Font newfont;
lpDisp=range.GetFont(); newfont.AttachDispatch(lpDisp);
// newfont.Attach(lpDisp);
newfont.SetName(COleVariant("Arial Black"));
newfont.SetSize(COleVariant((long)12));
VARIANT newValue;
newValue=newfont.GetBackground();
// newValue=newfont.GetColorIndex(); // newfont.SetColor(const VARIANT &newValue);
newfont.SetColor(newValue);
這個程式有問題,newValue的值我應設為多少才是紅色呢?
謝謝!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货