"Fortunate are those who take the first steps.” ― Paulo Coelho

Debugview.exe as rescue tool

DebugView is a developer friendly tool helps you to monitor debug output messages from local or nw system – from managed/unmanaged code. Recently I was debugging managed COM dll created in C# consumed in office application. I wanted a tool to debug end to end, Let say, your Office files VBA macro calls .NET COM dll for processing some complex logic and then returns the value to your macro.

In dev environment, we usually attach VS to the application and debug them, in VBA using debug.print statements. Assume that, you don’t have VS at your production server or customer machine where you wanted to debug them badly. Here is where debugview comes for rescue.

To write, debug statements from managed code, use Diagnostic having Debug.writeline. For VBA, use OutputDebugString. For other languages – use as here.

C#:- System.Diagnostics.Debug.WriteLine("This is from .NET before word instance.");

VBA:- Private Declare Sub OutputDebugString Lib "kernel32" Alias "OutputDebugStringA" (ByVal lpOutputString As String)
Private Sub DebugPrint(dbgOutput As String)
OutputDebugString dbgOutput
End Sub
Sub test()
DebugPrint ("Test message for the debugger")
End Sub

Note: Make sue you run as “Admin”.




March 22, 2015 Posted by | .NET General, Office | , , , | Leave a comment

Office server side automation is not supported- famous KB 257757

There is no surprise still developers tend to code some kind of office automation on server without knowing that is not supported by us.
Recently I have seen a case where the developer is creating an excel pivot charts in server(automation) using SQL Server, DTS along with some programming with It was working for him but all sudden it broke after migrating to latest server OS.
Here is the famous KB article which we keep sharing with dev’s and also famously referred in MS as “2 5 7 7 5 7” which talks about why this is not supported. More at; 257757 KB here –


April 17, 2014 Posted by | Uncategorized | | Leave a comment


%d bloggers like this: