September 2006 - Posts

Alex arrives safe and well
Little Alex finally made it through at 6.30pm last night (28 Sep) after a couple of hours of labour. He was 3.345kg (a lot smaller than Jess), and was 50cm long (which was about the same as Jess). Linda and Alex are doing great - he hasn't really woken up yet. Here are few shots:

Alex with his big sister Jess and Aunt Louise

The new addition with Mum and Dad

Posted: Sep 29 2006, 07:01 AM by nick | with 10 comment(s)
Filed under:
VSTO 2003 - How to detect cell edit is still in process
I've been doing a bit of VSTO work supporting a client that Linda (my wife) was working with before beginning her maternity leave (new bub due later this week), and have come across an interesting problem where a custom command button is still active when a user is editing a cell. If the user clicks the button, the edit is not committed, and when the value of the cell is read from code, the old value is returned. There is no programmatic way to commit the edit. For the particular application I'm looking after, the particular Excel workbook in a data entry application (chosen to maintain the end-clients existing workflow) that uploads the data to a server, so the issue with the uncommitted cell is pretty important.

A look at the newsgroups shows that this is one of the problems that doesn't have a clean solution. The best direct solution is to simulate the Enter key with a SendKeys, which is pretty fragile solution. I've found that the Recalaculate method of the Workbook throws an exception if it is called while a cell edit is in progress, so we can at least detect if the data is in a dodgey state before it is upload. As a secondary precaution, we're going to add an optional data summary message box or form to detail the exact data that is going to uploaded to the server so the user has a final chance to eye-ball it before it goes.

For historical reasons this is a VSTO 2003 project - I'll be interested to see if this problem is fixed in VSTO 2005.
Posted: Sep 25 2006, 07:58 AM by nick | with 5 comment(s)
Filed under: