Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-07-2019, 06:30 AM
MGW1138 MGW1138 is offline How to access Excel from Word Windows 10 How to access Excel from Word Office 2016
Novice
How to access Excel from Word
 
Join Date: Feb 2019
Posts: 2
MGW1138 is on a distinguished road
Smile How to access Excel from Word

I want to scan a system for open Excel workbooks.

Sub GetExcelData()
Dim WB As Workbook


For Each WB In Application.Workbook
If MsgBox("Do you want " & WB.Name, vbYesNo) = vbYes Then
MsgBox ("Yes")
End If
Next WB
End Sub

The compiler complain and thinks that workbook is a user defined type.
I do have the "Microsoft Office 16.0 Object Library" checked.

What am I missing.

Thanking you in advance (I have done Excel VBA for years but just starting Word)
Reply With Quote
 

Tags
excel to word



Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel or Access hollies Excel 17 07-18-2017 03:21 AM
How to access Excel from Word Excel or Access for DB? John H. Power Word 3 08-03-2016 11:52 AM
How to access Excel from Word How to access Excel worksheet data from Word jules43 Word VBA 1 03-23-2016 02:36 AM
How to access Excel from Word Moving addresses from a letter in word into access or excel docwilll Office 3 02-22-2014 03:40 PM
Excel to Access to Excel for report automation Nicholaspoe Excel Programming 10 10-08-2013 08:13 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:30 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft