Tag: vba
Range.Sort Throws an Error Even Though Cells Are Not Merged
Recently, we encountered an issue in our production environment where so-far-nicely-working complex spreadsheet threw an exception on Range.Sort. The error description was “to do this all merged cells should be of same size”. Unfortunately there was no merged cell and Excel was still complaining about merged cell. Finally I figured out that the range contained…
Export Outlook From, To, Subject, Receive Date and Other Meta Data Into Excel
I had a need to export all the emails’ meta data like From, To, Subject, Receive Date from Outlook. Quickly searching on the internet, I found the script at http://superuser.com/questions/816289/exporting-attachment-file-name-email-metadata-from-outlook-to-excel so I quickly created a spreadsheet and exported all the needed information. I have made following modification to the code Commented out exporting email body…
Resolved: Method ‘Sheets’ of Object ‘_Global’ Failed
We have a complex macro enabled spreadsheet. Today we got a ticket from the business user that Excel is throwing error: “Run-time 1004 error: Method ‘Sheets’ of object ‘_Global’ failed.”. I could not find an answer even after searching online for hours. None of the online discussion was giving the root cause of the error.…
2 Ways to Add Custom Path Animation Effect Using VBA in PowerPoint 2013
As Microsoft got rid of “Record Macro” button from PowerPoint 2013, it is extremely difficult to write a macro for PowerPoint which does what we want to do. Recently, I had a need for having an animation with custom path for a shape. I tried all possible solutions available on the internet and could not…
How to Replace VBA Code from Excel/Word
Have you ever had a situation where you wanted to replace the existing VBA code from Excel/Word and did not want to open up each file and change it? Well, remember that Excel and Word files are nothing but a zip file. You can easily create a program to replace the file from “zip” file.…
Excel VBA – Frequently Used Code Snippets
If you happen to occasionally work on Excel VBA, you would forget various functions and for a small but advanced VBA, you would have to use Google for each line of code. Here is all at one place.
MS Access: HTML Editor Control to Use in Forms
If you want to get HTML editor within MS Access form, there are couple of solutions available. The free solution I know is to get Not So Elegant HTML Editor. The problem with this editor is that After looking at this editor, you will never say “so cool” It is good for basic editing but…
MS Access VBA: Get/set Javascript Variable in Microsoft Web Browser ActiveX Control
In your MS Access application, if you are using Microsoft Web browser, we may have to interact with the JavaScript variable inside the loaded page. There is no obvious method exists in the Web browser control but using the following trick you can get/set the JavaScript variable in the webpage. Quick Tip Add JavaScript function…
ADODB Command.Execute Does Not Return Error for RAISERROR
Description I was executing a stored proc which would halt its execution using RAISERROR. When I tried to run the stored proc in Query Analyzer it worked fine and gave me error but in VBA it couldn’t halt the execution and continued to the next statement.