Wednesday, 27 April 2016

How To Check If Outlook Application is open by using VBA code / Outlook Open ?

When you play around with outlook macros to send mails, get mail data, etc, You will face an issue whether the end user has not opened the outlook.

If the outlook is not open when you run the code, you cannot get the desired results and your code will stop.

I made a simple code to check if the outlook is open while you run the code.

This can be used from Both Excel or Acces.


Sub CheckOutlookIsOpen()
    Dim oOutlook As Object
    On Error Resume Next
    Set oOutlook = GetObject(, "Outlook.Application")
    On Error GoTo 0
    If oOutlook Is Nothing Then
        MsgBox "Error : Outlook is not open! This cannot be run without opening outlook", vbCritical, "Error"
        End
    End If
End Sub

Saturday, 11 July 2015

How to change the module name in VBA / Edit Module Name In VBA


You might have noticed that when you create a module, VBA allocates a default name (Module1, Module2, so on).

It would be a professional look to your code if you change the module names as per the code inside.

We can change the default name of a module by following very simple steps below.


See the steps in a short video below :



Steps

1. Open your project in VBE (ALT + F11)

2. Select the Module from your project explorer.

3. You can see the Name property of the selected module in the properties panel.

4. Edit the name and give the name as you wish.


Notes :

-:- If project Explorer not visible, press CTRL + R

-:- If properties window is not visible, press F4 to make it visible.

-:- The naming criteria is subject to VBA's naming parameters.

    Saturday, 28 March 2015

    Removing Borders in Excel

    Adding borders to cells is a very common thing in Excel. You may add them to help draw attention to number, or to divide numbers from column headings in a table.

    Here is a quick way you can remove any borders applied to a cell or group of cells: simply press Ctrl+_ Ie, Ctrl + Shift + _ . (That is the underscore, which means you must hold down the Shift key as well.) Excel leaves the other formatting of the cell set, but removes any borders.

    Monday, 3 November 2014

    How To Format USB Drive with NTFS File System

    In Windows for formatting USB Drive only FAT or FAT32 Option is there if you wish to enable and use NTFS Format Option then continue reading this article
    What are the Advantages Of NTFS
    ?
    The advantage of NTFS file system is more security options and fast. Normally USB drive capacity is very small enough that NTFS is not recommended But, nowadays USB drives are coming with larger capacity also . So we can format USB drive with NTFS to have more security options

    NTFS enabled USB Drives are write-able only on one PC and becomes read only on all other PCs. Hence , we can read and write on our own PC and transfer files to elsewhere without any fear of virus.

    In Windows XP, only FAT and FAT32 file systems are available in format options use the below steps to format in NTFS File System.
    • Insert USB drive in your PC 
    • Go to Device Manager (Start > Run  > devmgmt.msc)
    • Select Disk Drives and expand.
    • Right Click on USB drive and select Properties.
    • Go to policies tab and select Optimize for performance and press OK 
    • Now Right click on USB Drive and select Format Option.
    Now you can select NTFS option there on the pop up.

    Friday, 28 March 2014

    Remove Gridlines From excel sheet

    Fed up with watching gridlines in you excel sheet ?

    Steps

    1. Open your worksheet , Go to Tools Menu > Options 
    2. In View Tab , You can see Window Options 
    3. By Defult Gridlines are ticked, Untick it , Click ok Button

    Then You have it


    Note: If you want to change color of gridlines, there is an option under it, change gridlines color in it & Tick Gridlines.