A way to open an Excel sheet from Word

  • Thread starter Thread starter Tonya Marshall
  • Start date Start date
T

Tonya Marshall

I would like the Excel sheet to open in Excel but would like to access
it from a toolbar button in Word.
Is that possible?
 
Hi Tonya,
one way would be to set a reference to the excel library,
"Extras, References, ..." and then the following may be a start:
Dim oExc As Excel.Application
Set oExc = New Excel.Application
With oExc
.Workbooks.Open "c:\test\test.xls"
.Visible = True ' if you like
' do something ...
.ActiveWorkbook.Save
.ActiveWorkbook.Close
.Quit
End With
Set oExc = Nothing
 
Hi Tonya,
I don't know what this means:

It is just one way to get access to all of excels functionality
from Word-VBA. Open the VBA-Editor (VBE) goto extras,
references, browse the list of references and check the
excel library. Step through the macro using F8 in the VBE.
 
Back
Top