MS Excel, sometimes we got some task which is time taking and require good manual effort. To automate these kind of task and making our life easy there are two ways -
1) Macro - MS Excel provide Macros functionality to automate tasks in Excel. We can record our steps ( go to 'View' tab then Record Macro) then run this recorded Macro to perform the same task again. It will be good if you know VB Scripting to write general algorithm Macros.
2) Python - Python has excel API xlrd and xlwt for reading and writing Excel documents. Python is easy to use and you can code easily as compare to VB Scripting. With Python Excel API we can easily automate the excel task.
I) Setup the environment -
- Download Eclipse - Eclipse is a Intergrated Development Environment in which we can easily write code.
- Download Python.
- Download Python Excel API.
- Open Eclipse - then go to Help menu bar - then Eclipse Marketplace
- Search pydev and install the Pydev - Python IDE for Eclipse
- After installing the Pydev go to Windows menu bar - then Preferences
- In left side of active window you will find Pydev - then Interpreter Python
7. Click on New button .
8. Type Interpreter Name as Python and click on Browse to navigate to python.exe in your
system python installation directory.
9. Click on OK - this will add the python libraries.
10. Click on OK and you successfully configure the Python in Eclipse IDE.
II) Setup the Python Excel API in Python
1) Extract both the xlrd and xlwt packages into Python installation folder. In my case it is -
c:\python27\
2) Open command prompt and go to xlrd directory -
cd xlrd-0.8.0
3) Execute below command for installation of xlrd libraries -
c:\python27\python.exe setup.py install
4) Go to below path for installation of xlwt libraries -
cd c:\python27\xlwt-0.7.4
6) Execute
c:\python27\python.exe setup.py install
7) Congratulations you successfully configured the Python Excel API.
Here you are, ready to automate the Excel.
For more documentation and tutorial please refer to Python Excel API site.
Nice Post...It actually saves a lot of time doing this way when you have some kinda work like translation where you can integrate this to Googel APIs..or reverse geocoding given a array of sheets from your boss :P
ReplyDeleteGood effort :)
ReplyDeleteThanks Naveen Kalyan
ReplyDeleteYour car might be stolen if you don't keep this in mind!
ReplyDeleteConsider that your car was taken! When you visit the police, they inquire about a specific "VIN decoder"
Describe a VIN decoder.
Similar to a passport, the "VIN decoder" allows you to find out the date of the car's birth and the identity of its "parent" (manufacturing facility). You can also figure out:
1.Type of engine
2.Model of a car
3.The DMV and the limitations it imposes
4.The number of drivers in this vehicle
You will be able to locate the car, and keeping in mind the code ensures your safety. The code can be viewed in the online database. The VIN is situated on various parts of the car to make it harder for thieves to steal, such as the first person's seat on the floor, the frame (often in trucks and SUVs), the spar, and other areas.
What if the VIN is intentionally harmed?
There are numerous circumstances that can result in VIN damage, but failing to have one will have unpleasant repercussions because it is illegal to intentionally harm a VIN in order to avoid going to jail or the police. You could receive a fine of up to 80,000 rubles or spend two years in prison. You might be held up on the road by a teacher.
Conclusion.
The VIN decoder may help to save your car from theft. But where can you check the car reality? This is why we exist– VIN decoders!