Omer -
In the other application, have you set a reference the the MS Excel
object model? If not, it has no idea what any of the Excel constants
mean (xlColumnClustered, for instance). You either need to set a
reference (Tools menu > References in the VB Editor), or find out what
long integer xlColumnClustered stands for. In Excel's VB Editor, open
the Immediate window, type a question mark, then the name of the
constant, and press Enter:
?xlColumnClustered
51
Assuming App is the name of the Excel Application object variable, this
line should work:
App.ActiveChart.ChartType = 51
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
rdoliveo < wrote:
> hey jon , thanks for answering
>
> basically the script works just fine if i run it as an excel macro (i
> stopped it with the stop recording button) . the problem begins when i
> am trying do the same thing from a vba script . i took the recorded
> macro and after using the getObject method to get a running Excel
> application (which i called App), i added the object name before each
> command.
>
> i am having a problem with the following line :
>
> App.ActiveChart.ChartType = xlColumnClustered
>
> and i am not sure which syntax is the right one :
> xlColumnClustered \ App.xlColumnClustered\ else ?
>
> omer
>
>
> ---
> Message posted from http://www.ExcelForum.com/
>