ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   vb6 vs vba question (https://www.excelbanter.com/excel-programming/401560-vb6-vs-vba-question.html)

avi

vb6 vs vba question
 
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

RB Smissaert

vb6 vs vba question
 
Try:

.Fill.OneColorGradient Style:=4

RBS


"avi" wrote in message
...
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



avi

vb6 vs vba question
 
It works!!!!

Thanks
Avi

RB Smissaert

vb6 vs vba question
 
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


"avi" wrote in message
...
It works!!!!

Thanks
Avi



Chip Pearson

vb6 vs vba question
 
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)


"RB Smissaert" wrote in message
...
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


"avi" wrote in message
...
It works!!!!

Thanks
Avi




RB Smissaert

vb6 vs vba question
 
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


"Chip Pearson" wrote in message
...
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)


"RB Smissaert" wrote in message
...
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


"avi" wrote in message
...
It works!!!!

Thanks
Avi






All times are GMT +1. The time now is 07:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com