If you want to encrypt the file as a whole, have a look at the JCE API, which is the standard Java API for en- and decryption. You can find some releveant links in the http://faq.javaranch.com/java/SecurityFaq.
If you're talking about the encryption offered by Excel, have a look at the POI library.