Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default addin problem: sheet mismatch by function parameters

I'm programming in visual c++ 6.0 and using microsoft excel 2002 servicepack 2.
I have made a addin for excel. The TestFunction is called by using the wizard. The TestFunction is called, with the following values:

Values for the Cells.
cell1 = sheet1.A1
cell2 = sheet1.A2
cell3 = sheet2.A5

The worksheets that i get from Cell1 and Cell2 are wrong. Im getting from Cell1 and Cell2, the same sheet as cell3. This only occurs if the code: €śrange.GetStyle€ť is executed.

STDMETHODIMP KFunctions::TestFunction (VARIANT* cell1, VARIANT* cell2, VARIANT* cell3, VARIANT* obj)
{
if (cell1 == NULL)
return (false);
if (cell1-vt != VT_DISPATCH)
return (false);
EXCEL_EXT::Range range (cell1-pdispVal);
EXCEL_EXT::_Worksheet ws (range.GetParent());
CString name = ws.GetName();
TRACE ("cell 1 = %s\n", name);
VARIANT tmp = range.GetStyle (); //this line is the problem
}

return values from Cells.
cell1 becomes sheet2
cell2 becomes sheet2
cell3 stays sheet2

Does anyone know how to resolve this problem....

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel problem - sumif with multiple parameters athletico Excel Worksheet Functions 2 July 7th 08 12:02 PM
An AddIn for a custom function FARAZ QURESHI Excel Discussion (Misc queries) 3 October 16th 07 02:35 PM
Function Parameters Paddyk Setting up and Configuration of Excel 2 April 12th 05 08:52 AM
Addin problem boopesh Excel Programming 1 December 11th 03 12:56 PM
Addin in read-only mode problem Stuart[_5_] Excel Programming 1 August 20th 03 02:41 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"