Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default SheetBeforeDoubleClick and merged cells

Dear Reader

I succesfully implemented SheetBeforeDoubleClick (Excell application level)
using VSTO end VS 2005 (professional)
It works as long as cells ain't merged together.
when I double-click on single cells everything works as expected, however any
merged cell seems to destroy the event hookup, since after this even clicking
a single cell does not work anymore.
Thus presents I reckon a serious drawback in the layout-possibility of a
spreadsheet
with C#-implemented add-inns.

I'm currently at a loss to this issue, any idea's I welcome!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default SheetBeforeDoubleClick and merged cells

It could be that you code is not dealing with merged cells correctly and is
producing errors.

NickHK

"Aale de Winkel" wrote in message
...
Dear Reader

I succesfully implemented SheetBeforeDoubleClick (Excell application

level)
using VSTO end VS 2005 (professional)
It works as long as cells ain't merged together.
when I double-click on single cells everything works as expected, however

any
merged cell seems to destroy the event hookup, since after this even

clicking
a single cell does not work anymore.
Thus presents I reckon a serious drawback in the layout-possibility of a
spreadsheet
with C#-implemented add-inns.

I'm currently at a loss to this issue, any idea's I welcome!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default SheetBeforeDoubleClick and merged cells

.....
app.SheetBeforeDoubleClick += new
Microsoft.Office.Interop.Excel.AppEvents_SheetBefo reDoubleClickEventHandler(app_SheetBeforeDoubleCli ck);
.....
void app_SheetBeforeDoubleClick(object Sh,
Microsoft.Office.Interop.Excel.Range Target, ref bool Cancel)
{
MessageBox.Show("Hello")
}

Changed to the above to test your assumption!
and indeed you seem to be right since both single cell and merged cell yield
"hello"
so there must be something inside my eventhandler that disables it to
function!

Thanks, I'll need to study further. It is just that I see nothing in my code
that makes
use of the fact that cells aren't merged. So the deactivation is unexpected.
Will take some time to figure out what exactly deactivates the event

Thanks

"NickHK" wrote:

It could be that you code is not dealing with merged cells correctly and is
producing errors.

NickHK

"Aale de Winkel" wrote in message
...
Dear Reader

I succesfully implemented SheetBeforeDoubleClick (Excell application

level)
using VSTO end VS 2005 (professional)
It works as long as cells ain't merged together.
when I double-click on single cells everything works as expected, however

any
merged cell seems to destroy the event hookup, since after this even

clicking
a single cell does not work anymore.
Thus presents I reckon a serious drawback in the layout-possibility of a
spreadsheet
with C#-implemented add-inns.

I'm currently at a loss to this issue, any idea's I welcome!




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default SheetBeforeDoubleClick and merged cells

You could record a macro i Excel of the actions on the merged cells to see
the required VBA. Then translate to C#.

NickHK

"Aale de Winkel" ...
....
app.SheetBeforeDoubleClick += new
Microsoft.Office.Interop.Excel.AppEvents_SheetBefo reDoubleClickEventHandler(app_SheetBeforeDoubleCli ck);
....
void app_SheetBeforeDoubleClick(object Sh,
Microsoft.Office.Interop.Excel.Range Target, ref bool Cancel)
{
MessageBox.Show("Hello")
}

Changed to the above to test your assumption!
and indeed you seem to be right since both single cell and merged cell
yield
"hello"
so there must be something inside my eventhandler that disables it to
function!

Thanks, I'll need to study further. It is just that I see nothing in my
code
that makes
use of the fact that cells aren't merged. So the deactivation is
unexpected.
Will take some time to figure out what exactly deactivates the event

Thanks

"NickHK" wrote:

It could be that you code is not dealing with merged cells correctly and
is
producing errors.

NickHK

"Aale de Winkel" wrote in
message
...
Dear Reader

I succesfully implemented SheetBeforeDoubleClick (Excell application

level)
using VSTO end VS 2005 (professional)
It works as long as cells ain't merged together.
when I double-click on single cells everything works as expected,
however

any
merged cell seems to destroy the event hookup, since after this even

clicking
a single cell does not work anymore.
Thus presents I reckon a serious drawback in the layout-possibility of
a
spreadsheet
with C#-implemented add-inns.

I'm currently at a loss to this issue, any idea's I welcome!






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default SheetBeforeDoubleClick and merged cells

for some reason my responses before hasn't shown up so my final solution to
the incomprehensable Redmond-logic is:

object TargetValue(Microsoft.Office.Interop.Excel.Range Target)
{
bool merged = (bool) Target.MergeCells;

if (!merged)
return Target.get_Value(Excel.XlRangeValueDataType.xlRang eValueDefault);
else
try
{
object[,] arr =
(object[,])Target.get_Value(Excel.XlRangeValueDataType.xlRan geValueDefault);
// new object[Target.Rows.Count, Target.Columns.Count];
return arr[1,1]; // VSTO logic C# should be arr[0,0] !!!
}
catch (Exception ex)
{
MessageBox.Show("TargetValue HUMBUG \r\n" + ex.ToString());
}
return null;
}


"NickHK" wrote:

You could record a macro i Excel of the actions on the merged cells to see
the required VBA. Then translate to C#.

NickHK

"Aale de Winkel" ...
....
app.SheetBeforeDoubleClick += new
Microsoft.Office.Interop.Excel.AppEvents_SheetBefo reDoubleClickEventHandler(app_SheetBeforeDoubleCli ck);
....
void app_SheetBeforeDoubleClick(object Sh,
Microsoft.Office.Interop.Excel.Range Target, ref bool Cancel)
{
MessageBox.Show("Hello")
}

Changed to the above to test your assumption!
and indeed you seem to be right since both single cell and merged cell
yield
"hello"
so there must be something inside my eventhandler that disables it to
function!

Thanks, I'll need to study further. It is just that I see nothing in my
code
that makes
use of the fact that cells aren't merged. So the deactivation is
unexpected.
Will take some time to figure out what exactly deactivates the event

Thanks

"NickHK" wrote:

It could be that you code is not dealing with merged cells correctly and
is
producing errors.

NickHK

"Aale de Winkel" wrote in
message
...
Dear Reader

I succesfully implemented SheetBeforeDoubleClick (Excell application
level)
using VSTO end VS 2005 (professional)
It works as long as cells ain't merged together.
when I double-click on single cells everything works as expected,
however
any
merged cell seems to destroy the event hookup, since after this even
clicking
a single cell does not work anymore.
Thus presents I reckon a serious drawback in the layout-possibility of
a
spreadsheet
with C#-implemented add-inns.

I'm currently at a loss to this issue, any idea's I welcome!






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
Copy paste non merged to merged cells [email protected] Excel Worksheet Functions 1 February 5th 09 05:25 PM
How can I sort an Excel Doc containing merged & non-merged cells? KellyH Excel Discussion (Misc queries) 11 June 10th 08 04:12 AM
Autofit Merged cell Code is changing the format of my merged cells JB Excel Discussion (Misc queries) 0 August 20th 07 02:12 PM
how do i link merged cells to a merged cell in another worksheet. ibbm Excel Worksheet Functions 3 April 27th 06 11:40 PM
Sorting merged cellsHow do I sort merged cells not identically siz Laval Excel Worksheet Functions 1 November 3rd 04 09:40 PM


All times are GMT +1. The time now is 04:52 AM.

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"