Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Office/VBA Object Model - Learning Resources?

Status
Not open for further replies.

baycolor

MIS
Mar 23, 2005
148
0
0
US
First question:
Does anyone have any recommended (free) sites that do a good job of teaching the object model? Something that starts at the newbie level and advances would be great. More interested in Excel than anything else.
I've Googled and found some stuff but was looking for input from the experts here.

Second question:
Any recommended books (obviously not free)? Again something that starts at the newbie level and advances would be great. Again more interested in Excel.

Thanks
 




I think that you will find that most of the "experts" on this forum, got their knowledge of the object model, VBA, Excel, PRIMARILY, by hands on, lots of trial and error, experimenting, etc

Use HELP. TRU STUFF.

Search for specifics. TRY STUFF.

Read post that have stars. TRY STUFF

I like books by John Walkenback. Read them. TRY STUFF.

Skip,
[sub]
[glasses]I'll be dressed to the nines this week, as I go to have my prostatectomy...
Because, if I'm gonna BE impotent, I want to LOOK impotent![tongue][/sub]
 
The object model reference material is installed by default when you install Office. For instance for a standard office install the Word object model is at:

C:\Program Files\Microsoft Office\OFFICE11\1033\VBAWD10.CHM

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
I am by now means an expert. I would definitely defer to Skip and others and I'm sure what they say is true.

I do know that as a very recent newbie to the entire field of vba, I could not figure it out just sitting in front of the editor window. I needed a little bit of hand-hodling in the form of a few books (one by Walkenbach, one by Birnbaum, one by Roman) to bootstrap my way into self learning mode. Then I learned all the tools that are available in the editor window and how I can use them to retrieve information. The immediate window and locals window for program development and troubleshooting. The object browser of course.

You probably have heard the large number virtues of using option explicit and I would recommend that. One huge advantage of declaring variables is that the editor knows the type of your variables and provides pull-down window choices as you type for properties, methods etc based on the object model.

If it is really the excel object model that you want to get familiar with, I would recommend "Writing Excel Macro's with VBA" by Roman. He actually does step through all of the major elements of the object model and provides useful hierarchical figures that he produced with some kind of custom object model browser. It is a useful hardcopy reference - well indexed and logically laid out
 
And of course another great learning tool... recording macro's and the inspecting the code that was gemerated by the macro recorder.
 



Big ditto, 10-4 on the macro recorder!!!

Skip,
[sub]
[glasses]I'll be dressed to the nines this week, as I go to have my prostatectomy...
Because, if I'm gonna BE impotent, I want to LOOK impotent![tongue][/sub]
 
Skip seems to have forgotten this nice tip he posted as a FAQ some years ago.

faq707-4594

 
I totally agree with Skip, as I usually do. There is NOTHING that compares to recording macros and then looking at the code. Keep in mind though that the macro recorder usually adds a huge bunch of extraneous junk code. Experience will allow you to be able to know how to chop off that extraneous crap, and write smaller, neater and faster code.

I posted a very long list of links to reosurces on your duplicate post in the Office forum.

faq219-2884

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top