Click here to Skip to main content
16,007,858 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCTreeCtrl is eating my WM_LBUTTONUP's :-( Pin
Taka Muraoka29-Aug-05 4:19
Taka Muraoka29-Aug-05 4:19 
AnswerRe: CTreeCtrl is eating my WM_LBUTTONUP's :-( Pin
Jack Puppy29-Aug-05 8:40
Jack Puppy29-Aug-05 8:40 
GeneralRe: CTreeCtrl is eating my WM_LBUTTONUP's :-( Pin
Taka Muraoka30-Aug-05 7:09
Taka Muraoka30-Aug-05 7:09 
Questionhow to write the data of datetime type in database to the html document? Pin
liuyue29-Aug-05 4:15
liuyue29-Aug-05 4:15 
AnswerRe: how to write the data of datetime type in database to the html document? Pin
Marc Soleda29-Aug-05 5:12
Marc Soleda29-Aug-05 5:12 
GeneralRe: how to write the data of datetime type in database to the html document? Pin
liuyue29-Aug-05 14:12
liuyue29-Aug-05 14:12 
GeneralRe: how to write the data of datetime type in database to the html document? Pin
Marc Soleda29-Aug-05 20:10
Marc Soleda29-Aug-05 20:10 
QuestionStarting macro from c++ Pin
Kreatief29-Aug-05 4:02
Kreatief29-Aug-05 4:02 
Hi,

I am dealing with Excel Automation. I get most things working, but now I have a very strange behaviour:

I created a big macro, which creates a pivot table from a normal table, and then makes a chart out of it.

When I run the macro from the excel file, everything works!
But, when I run the macro through a c++ program, it crashes.

Here my C++ code:

hr = CreateObject(OLESTR("Excel.Application"), &pdispApplication);

V_VT(&v) = VT_BOOL;
V_BOOL(&v) = TRUE;

hr = Invoke(pdispApplication, DISPATCH_PROPERTYPUT, NULL, NULL, NULL,
OLESTR("Visible"), TEXT("v"), v);

hr = Invoke(pdispApplication, DISPATCH_PROPERTYGET, &vRet, NULL, NULL,
OLESTR("WorkBooks"), NULL);

pdispWorkbook = V_DISPATCH(&vRet);

V_VT(&v) = VT_BSTR;
V_BSTR(&v) = SysAllocString(OLESTR("C:\\Dokumente und Einstellungen\\geh\\Desktop\\Excel Tests\\Test02.xls"));

hr = Invoke(pdispWorkbook, DISPATCH_METHOD, &vRet, NULL, NULL,
OLESTR("Open"), TEXT("v"), v);

V_VT(&v) = VT_BSTR;
V_BSTR(&v) = SysAllocString(OLESTR("Test02.xls!Chart"));

hr = Invoke(pdispApplication, DISPATCH_METHOD, &vRet, NULL, NULL,
OLESTR("Run"), TEXT("v"), v);


What it does:

It creates the pivot table, and creates a new chart. But when trying to set the XValue or Value from a new series, it says:

"The XValue-Propertie cant be set"

Here the code snippet from the macro:

Sheets.Add
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlBuiltIn, TypeName:= _
"Linie - Säule auf zwei Achsen"
ActiveChart.SetSourceData Source:=Sheets("Tabelle3").Range("A1")
Set st = ActiveChart.SeriesCollection.NewSeries
With st
.Name = "=""Anz. KLEs am Platz"""
.XValues = "=Tabelle2!R4C3:R4C57"
.Values = Values
End With


As I said, if run it directly from the xls file, it works!
And yes, the table "Tabelle2" is there, and opened.
If I put a "stop" before it, so that I can trace it, it looks totally equal!

Wheres my problem?


EDIT: I just solved it by using .XValues = Worksheets("Tabelle2").Range("A4:BP4")
But I still would like to know where my problem was!


DKT

-- modified at 11:05 Monday 29th August, 2005
QuestionIs it better solution for Refreshing Problem in List Control... Pin
Ravi Sankar S29-Aug-05 3:47
Ravi Sankar S29-Aug-05 3:47 
QuestionProblem with Eventlog in Windows 2003 server Pin
DasdaDAS29-Aug-05 3:34
DasdaDAS29-Aug-05 3:34 
QuestionCommunication with the existing driver Pin
Paresh emb29-Aug-05 3:27
Paresh emb29-Aug-05 3:27 
QuestionFormatting in the Rich Edit Control Pin
Dave Kerr29-Aug-05 3:25
Dave Kerr29-Aug-05 3:25 
Questionwho can tell me what fomat the audio file *.ssu is. Pin
wpjob29-Aug-05 2:24
wpjob29-Aug-05 2:24 
Answerthe data in the file is: Pin
wpjob29-Aug-05 2:28
wpjob29-Aug-05 2:28 
JokeRe: the data in the file is: Pin
toxcct29-Aug-05 2:41
toxcct29-Aug-05 2:41 
GeneralRe: the data in the file is: Pin
Jörgen Sigvardsson29-Aug-05 11:03
Jörgen Sigvardsson29-Aug-05 11:03 
AnswerRe: who can tell me what fomat the audio file *.ssu is. Pin
Cedric Moonen29-Aug-05 3:03
Cedric Moonen29-Aug-05 3:03 
QuestionThread problems... Pin
Lefteris_RG312029-Aug-05 2:21
Lefteris_RG312029-Aug-05 2:21 
AnswerRe: Thread problems... Pin
Jose Lamas Rios29-Aug-05 3:06
Jose Lamas Rios29-Aug-05 3:06 
QuestionSimple Question (sorry 4 the trouble again) :) Pin
Eytukan29-Aug-05 2:16
Eytukan29-Aug-05 2:16 
AnswerRe: Simple Question (sorry 4 the trouble again) :) [EDITED] Pin
toxcct29-Aug-05 2:22
toxcct29-Aug-05 2:22 
GeneralRe: Simple Question (sorry 4 the trouble again) :) Pin
Achim Klein29-Aug-05 2:35
Achim Klein29-Aug-05 2:35 
GeneralRe: Simple Question (sorry 4 the trouble again) :) Pin
toxcct29-Aug-05 2:37
toxcct29-Aug-05 2:37 
GeneralRe: Simple Question (sorry 4 the trouble again) :) [EDITED] Pin
Eytukan29-Aug-05 2:49
Eytukan29-Aug-05 2:49 
GeneralRe: Simple Question (sorry 4 the trouble again) :) [EDITED] Pin
Bob Stanneveld29-Aug-05 4:06
Bob Stanneveld29-Aug-05 4:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.