July 2008

You are currently browsing the monthly archive for July 2008.

If you’re doing some Excel automation like creating a sheet with some graphs from .NET, you may run into the “Old format or invalid type library” error which is quite nicely described in this Microsoft Support article.  At this moment there’s no fix available, but the article describes not one, not two, but three workarounds.  I chose the third one where you switch the Culture for your thread to “en-US”.

When giving this a try, it solved the error mentioned above but then I started getting “Exception from HRESULT: 0x800A03EC” errors.  After searching for a while I finally found the reason: you should not switch the Culture back to the original one after you’ve added your new Excel workbook as shown in the workaround.  First finish whatever you want to automate in Excel and switch the Culture back at the end.

In C# this looks like the following:

   1: // code below assumes the following using statement
   2: // using Excel = Microsoft.Office.Interop.Excel;
   3:
   4: // capture current Culture settings
   5: System.Globalization.CultureInfo systemCultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture;
   6: try
   7: {
   8:     // temporarily change CultureInfo to en-US
   9:     System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
  10:
  11:     Excel.Application excelApplication = new Excel.Application();
  12:     // create new workbook
  13:     Excel._Workbook workbook = (Excel._Workbook)(excelApplication.Workbooks.Add(Missing.Value));
  14:     // get active sheet
  15:     Excel._Worksheet worksheet = (Excel._Worksheet)workbook.ActiveSheet;
  16:
  17:     // create your graphs or whatever you were planning to automate in Excel
  18:
  19:     // give the user control over Excel
  20:     excelApplication.Visible = true;
  21:     excelApplication.UserControl = true;
  22: }
  23: catch (Exception ex)
  24: {
  25:     // handle exception
  26: }
  27: finally
  28: {
  29:     // put CultureInfo back to original
  30:     System.Threading.Thread.CurrentThread.CurrentCulture = systemCultureInfo;
  31: }
Share

Tags: , ,

I’m using Windows Live Writer (version 2008, build 12.0.1370.325) to write my posts on this WordPress 2.6 blog.  To be able to do this I had to make a couple of changes to the default configuration of WordPress.

  1. Activate XML-RPC in Settings > Writing, by default this is disabled.
  2. Modify the upload folder in Settings > Miscellaneous.  By default this was “wp-content”.  I changed it to “wp-content/uploads” and I created the uploads folder manually on the server (with 777 rights).  This is the folder where the images will end up.

After these two changes I was able connect to the blog with WLW and post the article about the black background issue (which contains an image).

Share

Tags: ,

Recently I came across a bug that was introduced in the Reporting Services part of SQL Server 2005 SP2. When previewing the “Print Layout” of the report it would show like this:

SSRS_preview_printlayout_bug

The by default Transparent background would show as black instead of white. Obviously this is not very convenient, especially when the text is also black.

Luckily Microsoft was already aware of this issue, its KB is located here.

I managed to solve the problem by installing Cumulative Update 1 (build 3161), which can be requested for download through the following Microsoft page: http://support.microsoft.com/kb/935356/en-us.

If you don’t like installing CUs, you could wait until SP3 ships in Q3 this year (this info comes from several sources, just do a search on “sql server 2005 SP3″).

Share

Tags: , , , , ,

© 2008-2017 BI: Beer Intelligence? All Rights Reserved