B.7. VBA Summary

 < Day Day Up > 

There are entire books dedicated to VBA, many of them very good. This appendix has only covered some very basic items that might be helpful to someone who has not had much experience with VBA. Most VBA books focus only on the core language and don't give you much help dealing with objects. Having stated that, mastering the VBA language makes your job of performing automation of other applications much easier.

I strongly suggest that when you use VBA, you use Option Explicit at the top of all your modules. This forces you to declare all variables. While some people consider this to be a pain, it ensures that you get an error message if you misspell a variable. I have helped people find errors that took hours to find that would have been found instantly if variable declaration had been required.

The most important thing to keep in mind is that your main goal is to get a job done with VBA. In most cases, inefficient code outperforms efficient work done by people. In the grand scheme of things, as long as your code works, you are ahead of the game. Other than that, you might get some style points from other people if you do something a certain way.

If you are interested in learning more about the VBA language, I recommend VB and VBA in a Nutshell: The Language by Paul Lomax (O'Reilly). The book covers the VBA language very well and is very easy to read.

     < Day Day Up > 

    Integrating Excel and Access
    Integrating Excel and Access
    ISBN: 0596009739
    EAN: 2147483647
    Year: 2005
    Pages: 132

    Similar book on Amazon

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net