vb6 vs vba question

A

avi

Hello,

I have a a piece of code that works well in VBA

The same code works well in VB6 apart the
"fill.Fill.OneColorGradient ...." line

xlApp.ActiveChart.SeriesCollection(1).Select
With xlApp.Selection
.Interior.ColorIndex = 13
.Fill.Visible = True
.Fill.ForeColor.SchemeColor = 12
.Fill.OneColorGradient Style:=msoGradientDiagonalDown,
Variant:=3, Degree:=0.903
End With

Could be that vb6 does not support some vba commands?

Thanks a lot
Avi
 
R

RB Smissaert

Things like msoXXX and XlXXX are MS Office and Excel constants respectively
and
when you use these in VB6 you need the actual value.
The simplest way to find out what these values are is to open the immediate
window in
the VBE by pressing Ctrl + G and then type in ? followed by the constant.
Then press the return key. There you will see the actual value.

RBS
 
C

Chip Pearson

The simplest way to find out what these values are is to open the
immediate

Or just set a reference to the Office typelib and use the constant name.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 
R

RB Smissaert

In general I try to avoid references as they can cause serious problems.
If the library is only for used for constants I would probably go with the
actual values.

RBS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top