Monday, January 31, 2011

Office VB Integration

After so many months I got something for my blog. I have used it in my professional life and think it could be useful for others too.
It all started when one of my senior in my company introduced me with EXCEL MACROs. I found it very interesting and started experimenting it. Slowly I found that the macro could even connect to database, any package and even Outlook.

If you are into reporting you can create your own code with your custom formatting in a click. If you use Visual Studio you could even set a time when a report will automatically be generated and the excel file will be sent to a set of recipient. You just need to create a query once and put your code on startup.

Even if you are not into reporting, this could be of great use like you are given a set of records in excel and you are asked to perform some task with that data. You need not copy and paste all that data. Just make it work for a single row and execute the same set of lines for all the rows in the sheet.

I found that many of the packages could also be integrated with VB like SIEBEL, SAP, etc. This will minimize your repeatable work. I will not go into package implementation in VB but you could do practically a lot from VB in your package with the code.

Coming to lighter uses you could perform formatting based on some condition in the sheet, any other file, web service, database or your package.

I will not say that I dont have time to write more details but I am not sure from where to start the implementation details. If you have any query please reach out to me because more than you I would be learning :)