Tuesday 27 November 2012

The connection for viewing your linked Microsoft Excel worksheet was lost.Microsoft JET Database Engine

When you use GetObject() function to open an excel file and work on it.

Use  <.Close>  to close the file. Else we generally end up with "The connection for viewing your linked Microsoft Excel worksheet was lost.Microsoft JET Database Engine " error. 

Tuesday 20 November 2012

Commenting VBA code using Edit Toolbar



  • In VBE Go to View - Toolbars
  • Select 'Edit' - this brings up the Edit toolbar
  • Highlight the code that you want to comment out
  • On the Edit toolbar select "Comment Block"
(There's also an "UnComment Block" to reverse this if needed)

Wednesday 14 November 2012

RTRIM does not trim CHAR(160)

Important - LTRIM and RTRIM only remove the space character CHAR(32). They do not remove a CHAR(160) which is a non-breaking space . The strings rtrim('12345' + char(160)) and rtrim('12345' + char(32)) are not the same.


Source - http://technet.microsoft.com