Wise Owl Answers - How do I refer to an open Word document in Excel VBA?

preview_player
Показать описание
By Andrew Gould

If you'd like to help fund Wise Owl's conversion of tea and biscuits into quality training videos you can join this channel to get access to perks:

This video explains how to get a reference to an open Word document using Excel VBA. You'll learn how to use the GetObject function to reference a running instance of Word and how to add error handling code to deal with occasions when Word isn't running. You'll also see how to quit the application, close all documents leaving the application open, close a single document and how to loop through the documents collection.

Chapters
00:00 The Question
00:51 Referencing an Existing Instance of Word
01:54 Adding Error Handling Code
03:57 Close All Documents but Keep Word Open
04:45 Close a Specific Document
05:27 Saving Changes when Closing a Document
06:30 Looping Through the Documents Collection

Рекомендации по теме
Комментарии
Автор

Please upload more excel vba tutorials...

prasathv
Автор

❤ thanks for th sharing amazing video... i have learned lots of new things .... now i am watching python series.... it's also amazing... could you please make similar video integration SAP with VBA

avairagade
Автор

I love your VBA videos, most helpfull tutorials on the web

aarsdruiper
Автор

Over the years I have learned a lot about vba. Mostly from you. Thank you very much

ep_un
Автор

I have a word macro that launches excel and then an excel macro takes over. Once the Excel macro is complete, it looks like control is passed back to Word. Once Excel finishes and focus is back to Word, I want to launch a file and copy content in word (I know how to do with VBA), but I want to go back to my open instance of Excel so I can paste there results in Excel. Once control comes back to the word macro, how do I get back to my open instance of Excel?

jokerbat
Автор

Thank you so much for this lesson.

And I have a little question about this sub. Don't we need a string "Set wd = Nothing" before Exit Sub ?

sergeylysov
Автор

Hi Andrew 👋

I love your teaching. Can we see you teach any other language apart from VBA in near future?

jegane
Автор

Your way of explaining is just great. I really appreciate what you do! Thank you so much !

HuTrzy
Автор

Thank you Andrew for sharing this great videos.

janezklun