Archive for the ‘.NET’ Category

In your Visual Studio IDE go to the projects (at the top) -> add references -> com (tab) -> add the Microsoft Excel library installed.


Or you can use the project explorer.

Right click on the references-> add references -> com (tab) -> add the library.


Please refer to the image below.


Then simply what you need to do is Import the Excel.

Imports Microsoft.Office.Interop.Excel for VB

using Microsoft.Office.Interop;              for C#


The “Microsoft Excel X Object Library” where X will depend on whatever version of Excel you have in the computer.
So the X depends on which version of Excel is installed on your machine.


Read Full Post »

I have been changing machines quite frequently since the last 6 months. And each time I have a new machine I need to setup the environment as I prefer.

The tabs spaces the fonts the immediate window and the list goes on.

But one thing I always forget is where is the setting for the Line Numbers to appear so this blog is for me


Tools -> Options -> Text editor- > All languages -> General -> Display (Line Numbers)


Hope this helps other fellow readers as well.

Read Full Post »

Well I had the chance to present on Microsoft Innovation Days here in Lahore, Pakistan.
It was a great experience, something out of this world. I have been presenting on cutting edge technologies for quite sometime now, but this was huge for me. I was presenting to an audience consisting of CEO’s, CIO’s, CTO’s and top level managers of leading organizations in Pakistan.
Well I guess all went as planed (thanks to Almighty) and I was able to introduce this new revolutionary web technology (Microsoft Silverlight) to the masses. I am sharing this presentation with the rest of you here.
I have been following the path Web Applications have taken for the past decade, and I am sure Microsoft Silverlight is going to revolutionize them even further.

[rockyou id= 96662232]

Read Full Post »

I was taken by surprise when one of my servers hung up. No web site was showing I was getting an error of service not available message in my explorer. I remotely logged into my server and found out that one of  the drives had run out of space; and the disk cleaning utility had fired up and was running consuming all the resources of my server. That was bad news for me.

So I decided to create a utility for alerting myself before time and here is a piece of code that I would like to share.

I am using the new class of DriveInfo available in .Net 2.0 in the System.IO namespace.

I simply send an email alert at my address informing me that its time for re-actions 🙂 .

    Dim CDriveFreeSpace As Long = 2147483648                                    2GB
    Dim DDriveFreeSpace As Long = 1073741824                                    1GB

    For Each curDrive As DriveInfo In My.Computer.FileSystem.Drives
      If curDrive.DriveType = DriveType.Fixed Then
        Dim theFreeSpace As Long = curDrive.AvailableFreeSpace
        If curDrive.Name = “C:\” And theFreeSpace <= CDriveFreeSpace Then
                  ‘ send mail
        End If
        If curDrive.Name = “D:\” And theFreeSpace <= DDriveFreeSpace Then
                  ‘ send mail
        End If
      End If

You can use the code as you like create a VB application, schedule it or else and please do share with me in what different ways can one use this code to solve the problem that I have just encountered.


Read Full Post »

Well another revolution by Microsoft is on its way.

Silverlight has been officially released.


I have developed a little web application using Windows Expression Blend and Visual Studio Orcas and was really impressed. Well being a web developer I can forecast that this lethal combination of MS to integrate animation and the basic web is awesome. It was always a nuisance to include flash files into the web projects that I used. And the biggest catch was that a developer was really not able to manipulate the time sequences that were available in the animation. So Silverlight enabled project gives you more FREEDOM to work around with the animations to bring your web application to life.


Read Full Post »

Well I was working on a project that had a reference to a number of DLL’s.

One day I had to face this problem “The project file ‘ ‘ has been renamed or is no longer in the solution.”. I had been programming in VS 2003 for quite some years now but never had faced this problem, it was the first time that I had seen such an error that gave no description of what went wrong with the project itself. Now I have been using VS 2005 for the last 6 months, but this was stranger than I thought. So I started to look into different options as to get the project loaded from the backup and checking my connections etc; but all in vain.

Finally I landed on checking the reference to my project through the property pages. Here I found out that the project dll that I was referencing was un-available due to some reason I simply removed it and added it back again and I was good to go. Alas, I had a solution!

You too can solve the problem by checking the reference to your assemblies or projects that are missing.


Thanks to Michiel.


Read Full Post »

Read Full Post »

Older Posts »