A way to open an Excel sheet from Word

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?
 
H

Helmut Weber

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
 
H

Helmut Weber

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top