Category ArchiveMicrosoft



Microsoft 26 Aug 2009 04:36 pm

Excel Worksheets are not Zero-Based: Exception from HRESULT: 0×800A03EC

I experienced the following message while trying to write to an Excel file from C# code using Interop:

System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC
   at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
   at Microsoft.Office.Interop.Excel.Range.set__Default(Object RowIndex, Object ColumnIndex, Object )

The problem was down to inserting values at a zero index.  Excel documents begin their range at 1, not 0.  Now that’s a mindshift for a long-time zero-based programmer!

C# & Microsoft & Software 18 Jun 2009 05:46 pm

Guji in Habanero Land #4: Using XSLT and XML to list Business Objects in a Word Document

Use cases are an important part of the communication between a client and a developer, or a user and a business analyst. That much is evident, since they are written in plain English and describe the business process in detail from the user’s point of view.  All this is great except these use cases seem to create a huge administration overhead. What’s that I hear you say? “That’s the Project administrator/co-ordinators job”? No, we don’t have such a luxury! (We chose premium filter coffee and an espresso machine over having a co-ordinator).


Continue Reading »

.NET & Chillisoft & Databases & Microsoft 02 Jun 2009 03:04 pm

Microsoft SQL Server Reporting Services “Object reference not set” error

I had a system deployed to a client site, and everything was working perfectly. The system administrator at the client site did a few things on the server, and next thing the Reports in the web site that use Microsoft SQL Server Reporting Services were giving an error.

Nothing had changed that should have affected the site! So, what could be causing the error?

The error in the report viewer was: “Object reference not set to an instance of an object.”

That’s an all too familiar error to anyone that has programmed in .NET and it is always slightly amusing to find it in someone else’s released program. The other day I got one from SQL Server Administrator when I clicked on something in the tree view on the left (just after I had freshly installed Reporting Services). Aha, so they are not infallible! A slight grin etched itself across my face. Well, anyway, the solution was a tried and tested standard Windows solution… Restart the PC. Amazing how often that works with Microsoft stuff hey! But in my case I was getting the error in my application, in a section that I had no control over, so how could I save myself this embarrassment?
Continue Reading »

Microsoft 15 Dec 2008 10:25 am

Getting the Current Directory of your Application

With the .Net framework, there seem to be a number of ways of accessing current directories, and sometimes the tendency has been to use trial and error until you get the one that works for you. The danger of course is that you could be using an incorrect approach that works while you’re testing and then bombs out in the live environment, hence the infamous saying: “But it works on my machine!”

Directory.GetCurrentDirectory() is a changing value. It begins as the working directory of your application and gets modified as you go. In my case, it was being modified when I opened a file dialog. Getting the working directory of an application is a different property call:

Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)

Microsoft & Software 11 Nov 2008 02:00 pm

Small Basic: The Official Chillisoft Review

Here on the Chillisoft Blog we recently mentioned the release of a new programming language by Microsoft from their DevLabs.  Small Basic is a simplistic language and IDE intended to create a fun environment for new coders to be introduced to programming.  A good concept.  I’ve now downloaded the package and have fiddled around for a while and am ready to throw in my tuppence.
Continue Reading »

Microsoft 11 Nov 2008 09:36 am

Microsoft Releases a New Programming Language

My development career started out simple.  When I was 13, we bought a second hand Commodore64 for R300 ($100 at that time).  A particular boon was that the previous owner threw in the manual for BASIC along with it, which was a real blessing.  I had no contact with assembly language, so I just chugged away with sprites and the C64’s great 8-channel sound.  It was slow, but that’s how I learnt programming.  Now I’m a career developer.

Microsoft have released Small Basic, a new simplified BASIC language to make the experience fun for children and new programmers, and I can certainly vouch for the importance of simplicity.
Continue Reading »

Microsoft 05 Nov 2008 10:50 am

Will Microsoft Kill LINQ to SQL?

Fresh news out of the Microsoft camp seems to have the development community up in arms again.  The ADO.Net team have posted a new blog entry (available here), which seems to indicate that the next version of .Net will abandon LINQ to SQL and go in favour of Entity Frameworks.  Tim Mallalieu is quoted on the blog as saying: “as of .NET 4.0 the Entity Framework will be our recommended data access solution for LINQ to relational scenarios”.
Continue Reading »

Microsoft 04 Nov 2008 10:58 am

Windows 7 Gives a First Glimpse

One wonders what new features an OS developer could think of these days?  With a usability background, I’m aware of the concept of irreducible complexity, that there comes a stage where you cannot improve a control or a tool beyond a certain level, because the problem is simply too complex to be simplified.  For instance, rocket science can be dumbed down to reach the man on the street, but if you really want to be a rocket scientist, you either have to understand the maths or pick a different career.  Hence the emphasis on looks more than functionality with the release of XP and Vista.
Continue Reading »

Microsoft 02 Sep 2008 10:27 am

A Useful MS Excel Shortcut

If you’re a software developer or capture data regularly, you’ll know that shortcuts can make a huge difference to the efficiency with which you work.  Here’s a very useful Excel shortcut that remains a little hidden if you’re not aware of it…

If you have a set of columns with different kinds of values, such that each requires a different column width, often you find that some of the columns don’t show all of their data.  Simply highlight all the columns that might be affected and then double-click on the column separator line (in the column header row).  Excel will re-adjust the column width of all the selected columns to match the data each column holds.

Microsoft 14 Aug 2008 01:12 pm

Tech-ed South Africa 2008

So last year I was debating going to Tech-ed, and in the end the cost of going all the way to Sun City prohibited us from sending someone for what was going to be of uncertain benefit. This year it was held in Durban at the ICC, and, us being only about 80kms from Durban the cost was much less, especially since I could stay with family.

When it comes to Microsoft I’ve always been a sceptic because they focus on technologies and API’s over principles and practices, and I worry about their internal coding practices (I know they’re all very bright, but there’s a case for developers being too bright for their own, or their customers’ good).
Continue Reading »

C# & Microsoft 01 Oct 2007 07:30 am

Default Values in a New Grid Row

When you’re using an editable grid (such as the EditableGrid feature in Habanero), where a user simply adds items to the grid using the new row at the bottom, you’ll sometimes want to supply default values in some of the cells.
Continue Reading »

Microsoft 10 Aug 2007 03:33 am

To Tech-Ed?

I’ve been looking at this year’s South African Tech-Ed schedule, and wondering whether it would be worthwhile going. I’ve been to a few Microsoft DevDays and to a few conferences before with Microsoft speakers, and my overriding impression of them was that they were not aimed at me, a developer that writes business software and happens to sometimes use Microsoft products to do so. They always seemed to be aimed at people who think tools are “cool”, I mean the guy giving the talk would sort of hook up his laptop, load up some code and show us this awesome thing called IntelliSense, or how easy it was to make a Web Service in Visual Studio.
Continue Reading »