Maybe I didn't name the subject correctly. In general, is there any good documentation on
interfacing to excel from C++? I can get a few things to work but others won't compile. Maybe I have
incompatible dll's? Is this the right newsgroup?


I've been able to cause VC++ 6.0 (no mfc) to create a chart in excel. Eg,

.....

chart->ChartWizard(
(Excel::Range*) range, // source
(long) Excel::xlXYScatter, // Gallery
6L, // Format (1-10)
(long) Excel::xlColumns, // PlotBy
1L, // 1 CategoryLabels
0L, // 0 SeriesLabels
2L,
title,
"Time",
"Value"
);


I can then set the name of the chart with:

chart->Name = "Test Plot";

Now I'd like to turn on the axes major and minor grid lines, but can't figure out the syntax.
I tried this:

chart->Axes(Excel::xlValue, Excel::xlPrimary)->HasMajorGridlines = 1;
but get a compilation error:

\main.cpp(870) : error C2664: 'Axes' : cannot convert parameter 1 from 'enum Excel::XlAxisType' to
'const class _variant_t &'
Reason: cannot convert from 'enum Excel::XlAxisType' to 'const class _variant_t'
No constructor could take the source type, or constructor overload resolution was ambiguous
c:\_flo5\excel\main.cpp(870) : error C2227: left of '->HasMajorGridlines' must point to
class/struct/union

I'd also like to be able to set the y-axis scaling programatically.


Can someone tell me what the correct way to do this is in C++?

thanks,
David