Click here to Skip to main content
15,887,474 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionaccess excel using c++ Pin
browneyes8629-Mar-10 10:25
browneyes8629-Mar-10 10:25 
AnswerRe: access excel using c++ Pin
Adam Roderick J29-Mar-10 19:22
Adam Roderick J29-Mar-10 19:22 
GeneralRe: access excel using c++ Pin
browneyes8631-Mar-10 3:29
browneyes8631-Mar-10 3:29 
AnswerRe: access excel using c++ Pin
Cool_Dev29-Mar-10 20:14
Cool_Dev29-Mar-10 20:14 
GeneralRe: access excel using c++ Pin
browneyes8631-Mar-10 3:32
browneyes8631-Mar-10 3:32 
GeneralRe: access excel using c++ Pin
Cool_Dev31-Mar-10 4:00
Cool_Dev31-Mar-10 4:00 
GeneralRe: access excel using c++ Pin
browneyes8631-Mar-10 4:30
browneyes8631-Mar-10 4:30 
AnswerRe: access excel using c++ Pin
David Crow30-Mar-10 3:39
David Crow30-Mar-10 3:39 
buki86 wrote:
_variant_t raw_data[10];


Shouldn't this be 11?

buki86 wrote:
_variant_t vItem = pRange->Item[(long) 1][(long) iColumn ];


Since the range is only one cell, both the row and column will be 1.

buki86 wrote:
pRange = pSheet->GetRange( _bstr_t("B2"), _bstr_t("B12") );

for ( int iRow = 1;iRow < 10; ++iRow )


The range you are defining has 11 rows. The loop will run 9 times. Is that intentional?

Try something like:
for (int iRow = 0; iRow < 11; ++iRow)
{
    _variant_t vItem = pRange.GetItem(COleVariant(iRow + 1L), COleVariant(1L));
    _bstr_t bstrText(vItem);
    raw_data[iRow] = vItem;
    cout << (long) raw_data[iRow];
} 

"One man's wage rise is another man's price increase." - Harold Wilson

"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

"Man who follows car will be exhausted." - Confucius


GeneralRe: access excel using c++ Pin
browneyes8631-Mar-10 3:36
browneyes8631-Mar-10 3:36 
AnswerRe: access excel using c++ Pin
David Crow31-Mar-10 4:44
David Crow31-Mar-10 4:44 
QuestionHow to detect if CEdti lost focus by mouse, keyboard or another event Pin
manchukuo29-Mar-10 9:25
manchukuo29-Mar-10 9:25 
AnswerRe: How to detect if CEdti lost focus by mouse, keyboard or another event Pin
Chris Losinger29-Mar-10 9:35
professionalChris Losinger29-Mar-10 9:35 
AnswerRe: How to detect if CEdti lost focus by mouse, keyboard or another event Pin
Eugen Podsypalnikov29-Mar-10 9:44
Eugen Podsypalnikov29-Mar-10 9:44 
AnswerRe: How to detect if CEdti lost focus by mouse, keyboard or another event Pin
manchukuo29-Mar-10 11:28
manchukuo29-Mar-10 11:28 
Question#pragma optimize("",on) #pragma optimize("",off) Pin
ForNow29-Mar-10 6:59
ForNow29-Mar-10 6:59 
AnswerRe: #pragma optimize("",on) #pragma optimize("",off) Pin
Randor 29-Mar-10 7:41
professional Randor 29-Mar-10 7:41 
AnswerRe: #pragma optimize("",on) #pragma optimize("",off) Pin
Stuart Dootson29-Mar-10 7:42
professionalStuart Dootson29-Mar-10 7:42 
GeneralRe: #pragma optimize("",on) #pragma optimize("",off) Pin
ForNow29-Mar-10 9:02
ForNow29-Mar-10 9:02 
QuestionRe: #pragma optimize("",on) #pragma optimize("",off) Pin
David Crow30-Mar-10 4:00
David Crow30-Mar-10 4:00 
AnswerRe: #pragma optimize("",on) #pragma optimize("",off) Pin
ForNow1-Apr-10 10:14
ForNow1-Apr-10 10:14 
GeneralRe: #pragma optimize("",on) #pragma optimize("",off) Pin
David Crow1-Apr-10 10:19
David Crow1-Apr-10 10:19 
Questionwhat is wrong with my VC6? [modified] Pin
includeh1029-Mar-10 6:57
includeh1029-Mar-10 6:57 
QuestionRe: what is wrong with my VC6? Pin
Maximilien29-Mar-10 7:27
Maximilien29-Mar-10 7:27 
AnswerRe: what is wrong with my VC6? Pin
Chris Losinger29-Mar-10 9:04
professionalChris Losinger29-Mar-10 9:04 
AnswerRe: what is wrong with my VC6? Pin
includeh1029-Mar-10 11:33
includeh1029-Mar-10 11:33 

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.