PST size in outlook does not decrease even after deleting emails?

Here is why it does not:

Even when the emails are deleted, PST file size would remain what it was before deleting emails. However the unused space is used as emails keep coming in to your PST file and that’s how space is allocated. However on your hard disk, that unused space continues to remain occupied. Not a smart way to use your storage, is it?

So here’s what you do to fix that.

If the PST file size is larger(I know a subjective term, but the one I had was 13 GB), it is likely to have errors, so first go ahead and run scanpst.exe. Select the PST file that is in trouble. This runs in 2 phases, first analyze the file and then actually repairing it.

Once it is done analyzing it, it will tell you the number of errors etc. Once done, hit repair. Now this process might take some time depending on the size of your PST file. Your dialogue box might also turn into “Not responding”, but have patience, its gonna come back. A log file would have been created at the same place where your PST file is. Just in case, you want to review what did this repair utility did.

Once the repair process is done, Right click on PST file in outlook –> Data File properties –> Advance –> Compact. Now this too can take quite some time, depending upon your the size of your PST file. Once done, go back to the folder where you had your PST file and check for yourself, the PST file size would have reduced to what actually it should be after deleting emails.

I had 13 GB PST file, deleted almost all emails, encountered this problem, followed what I just stated above and PST size is now just 62 MB.

Hope this helps!


Sunil Thacker

How to use “Enabler for Excel” API to Sales force for your VBA Macros

There would not be any point in doing this unless it serves the purpose to either the result of what you are doing or how you are doing it. so its better to ask “WHY” before you take on this path to do your sales force reports.
So, lets address that first!

Why does one need to use an API to import the data/report from Sales force?

Well, there are various reason why one would have to or want to use this way of doing sales force reports. Here are a few.

1. Sometimes the data/report that you get from sales force is not how you want to present it. so you need that data to be in excel and then put your formats in place. Reason for that could be audience of the report prefers the data in one way or the other.
2. Sometimes sales force does not allow you to schedule the report but by using this API with VBA macro, you can actually schedule the report and run it as many times as you want and when you want.
3. Because VBA is pretty comprehensive in automating reports, we can have fully automated reports.
4. You do not have to interact with sales force at all, once you are done setting up your API and your code in VBA.

So there could be many more reasons. Above given reasons are the ones why I chose to use the enabler for Excel API.

Now if you ask, why this API only and not any other? Well, that’s because this API was lucky to get to my attention first and I just happened to figure it out in a few minutes and I liked how easier it is to use it.

So, I’d provide you a few links below on how to install this free API. Once you install it, follow my instruction on how to write a few lines of code to make it work.

Get your “Enabler for Excel” API from here
How to install and wiki for this API

So the first link is where you get your API installed, and second one is where you learn how to install API.

Now that you have your API installed, Here is the essential code for how to use Excel for Enabler API and use VBA macro to import data/report from sales force.

Note – Green is the comments, explaining each line of code.
====================CODE STARTS

Private Sub ImportReport()

Dim addin As Office.COMAddIn
Dim automationObject As Object
Dim error As String
Dim error1 As String
Dim Result As Boolean
Dim ReportResult As String

this code sets “Enabler For Excel” as ADDIN for “automationObject” OBJECT

For Each addin In Application.COMAddIns
If addin.Description = "Enabler for Excel" Then
Set automationObject = addin.Object
End If
Next addin

Login to environment “password and security token has to be in one word” ; “URL could sometimes be different based on the organization you work for, so do check before pasting this code”

Result = AutomationObject.LogIn("UserName","PasswordSecurityToken", "",error)

So if the authentication fails in the code above that it would have return’ed false and this condition would be true and hence the error message would be displayed, which is contained in variable error an’d at this point entire function ends, none of the below code gets executed.

If Result = False Then
MsgBox error
End If

At this point our authentication is done. We are just running a report that we already have created in sales force. We are using a 15 or 18 character Report Id to identify which report do we want to run. Where do we get Report Id? Well just open your sales force report and see the URL in your browser now. there you will find your Report ID, just paste that id between double quotes here

ReportResult = automationObject.RunReport("XXXXXXXXXXXXXXX", error1)

Dim ws As Worksheet
Set ws = ActiveSheet

This code paste entire report on cell C6 onwards, I could use any according to my convenience.
Now you have your data in Excel, run your further automation on this format it and you can make a report completely automated without even looking at it.

With ws.QueryTables.Add(Connection:="TEXT;" & ReportResult, Destination:=ws.Range("C6"))
.TextFileParseType = xlDelimited
.TextFileCommaDelimiter = True
End With

End Sub

====================CODE ENDS

Movie Review – Jab Tak Hai Jaan

Official Trailer –

Movie on IMDB –

Movie on Wiki –

The movie gives you an experience to refresh yourself. A very decent love story with a very different Angle to love. The back ground score is amazing. A R Rehman is just great. I like those famous JTHJ lines by SRK, A song “Sanso me teri..” and that bubbly number on Akira “Jiya jiya re jiya..”. A Yash Chopra with his direction giving every scene brighter is a winner too. A fresh story to a love triange. Finally a movie which has some content(those who are bored with typical comedy movies, this one’s for you). Katrina is learning acting, but she still was expressionless. Akira is too good, SRK as always great at Romance. As they say, this guy can ROMANCE with even a bloody tree. Whats not right about the movie? Here we go.. as every other KJo and YRF movie, SRK takes 70% of the screen time, irrespective of the stature of other actors in the movie. Katrina too, is sacrificing here, but the movie is all about Samar Anand. A song or two could have been avoided to keep the audience interested. Its just too long to hold on to it, you loose the interest inbetween. So I’d go with 3 on 5 for this last love saga by YASH ji, the Legend.

Movie Review – Man on a Ledge

Official Trailer –

Movie on IMDB –

Movie on Wiki –

The best thing about this movie is, after first 15 minutes, it just keeps you with it. You don’t want to miss a bit in the movie. The story telling is good here. The content, the story itself scores here. Not sure why there was a need of a lady playing a role to talk down this guy. It could just have been any other guy. In fact the guy Edward Burns was already there with his peculiar accent. Movie does tend to feel like its similar to what we have seen in The Negotiater starring Samuel Jackson and one of my favourites Kavin Spacey. However this movie does have its own space. Sam has done a good job. Direction and back groud score too are doing justice. You won’t regret a tub of pop corn and a couple of expensive tickets. I’d give 3 on 5 and a generous version of me would add a half to that.