Тёмный

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

WiseOwlTutorials
Подписаться 208 тыс.
Просмотров 3,7 тыс.
50% 1

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:
/ @wiseowltutorials
Or you can click this link www.wiseowl.co.uk/donate?t=1 to make a donation. Thanks for watching!
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
Visit www.wiseowl.co.uk for more online training resources in Microsoft Excel, Microsoft Power BI, DAX, VBA, Python, Visual C#, Microsoft SQL Server, SQL Server Reporting Services SSRS, SQL Server Integration Services SSIS, Microsoft Access and more!

Опубликовано:

 

5 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 23   
@ep_un3129
@ep_un3129 11 месяцев назад
Over the years I have learned a lot about vba. Mostly from you. Thank you very much
@WiseOwlTutorials
@WiseOwlTutorials 11 месяцев назад
Happy to hear that you've found the VBA videos so useful, thanks for watching!
@HuTrzy
@HuTrzy 9 месяцев назад
+1
@aarsdruiper3000
@aarsdruiper3000 11 месяцев назад
I love your VBA videos, most helpfull tutorials on the web
@WiseOwlTutorials
@WiseOwlTutorials 11 месяцев назад
Thanks, happy to hear you like the videos and thanks for watching!
@tejamarneni
@tejamarneni 11 месяцев назад
As always amazing video.
@WiseOwlTutorials
@WiseOwlTutorials 11 месяцев назад
Thanks Teja!
@HuTrzy
@HuTrzy 9 месяцев назад
Your way of explaining is just great. I really appreciate what you do! Thank you so much !
@WiseOwlTutorials
@WiseOwlTutorials 9 месяцев назад
Thanks! Happy to hear you're enjoying the videos, thanks for watching and for taking the time to leave a comment!
@prasathv6258
@prasathv6258 11 месяцев назад
Please upload more excel vba tutorials...
@janezklun
@janezklun 10 месяцев назад
Thank you Andrew for sharing this great videos.
@WiseOwlTutorials
@WiseOwlTutorials 10 месяцев назад
A pleasure as always Janez, thank you for watching!
@kapibara2440
@kapibara2440 11 месяцев назад
Usefull materiał! Thank you :)
@WiseOwlTutorials
@WiseOwlTutorials 11 месяцев назад
You're welcome, thanks for watching!
@avairagade71
@avairagade71 11 месяцев назад
❤ 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
@WiseOwlTutorials
@WiseOwlTutorials 11 месяцев назад
Hi! Happy to hear that you're finding the videos useful! Sorry but it's unlikely that we'll have videos covering SAP integration with VBA.
@jegane
@jegane 11 месяцев назад
Hi Andrew 👋 I love your teaching. Can we see you teach any other language apart from VBA in near future?
@WiseOwlTutorials
@WiseOwlTutorials 11 месяцев назад
Hi! Apart from VBA we already have videos on T-SQL, Visual C#, DAX and Python. The next language that we'll probably have videos on is Office Scripts. I hope that helps!
@sergeylysov536
@sergeylysov536 10 месяцев назад
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 ?
@WiseOwlTutorials
@WiseOwlTutorials 10 месяцев назад
You're welcome Sergey, thanks for watching! You can add an explicit Set wd = Nothing but that will happen anyway when End Sub is reached and the variable goes out of scope.
@jokerbat11
@jokerbat11 3 месяца назад
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?
@WiseOwlTutorials
@WiseOwlTutorials 3 месяца назад
Hi! I'm assuming you have a variable which you use to launch Excel in the first place? Something like Dim xlApp as Excel.Application Set xlApp = New Excel.Application So you can refer to Excel by saying xlApp.Whatever Feel free to share your code if it makes things easier.
Далее
Это iPhone 16
00:52
Просмотров 416 тыс.
ELA NÃO ESPERAVA POR ISSO 🥶 ATTITUDE #shorts
00:20
кажется, началось
00:45
Просмотров 1,9 млн
LINKING DATA FROM EXCEL TO WORD || EXCEL
4:13
Просмотров 21 тыс.
Open Word Document from Excel VBA UserForm
12:14
Просмотров 31 тыс.
How to Combine Multiple Excel Files using VBA
19:06
Просмотров 32 тыс.
VBA to BROWSE & COPY Data from SELECTED File in Excel
10:00
Это iPhone 16
00:52
Просмотров 416 тыс.