If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
A way to open an Excel sheet from Word
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? |
#2
|
|||
|
|||
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 --- Greetings from Bavaria, Germany Helmut Weber, MVP "red.sys" & chr(64) & "t-online.de" Word 2002, Windows 2000 |
#3
|
|||
|
|||
Helmut Weber wrote:
Hi Tonya, I don't know what this means: 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 --- Greetings from Bavaria, Germany Helmut Weber, MVP "red.sys" & chr(64) & "t-online.de" Word 2002, Windows 2000 -- Tonya Marshall tonz AT harborside DOT com |
#4
|
|||
|
|||
Hi Tonya,
I don't know what this means: one way would be to set a reference to the excel library, "Extras, References, ..." and then the following may be a start: 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. --- Greetings from Bavaria, Germany Helmut Weber, MVP "red.sys" & chr(64) & "t-online.de" Word 2002, Windows 2000 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Opening Excel Files in Word | avj | General Discussion | 10 | July 31st, 2004 01:39 PM |
Macro help please: Excel data to word doc | anna-maria | General Discussion | 5 | June 30th, 2004 11:53 PM |
Field code to pick up Excel sheet | Lyndie | Mailmerge | 1 | June 2nd, 2004 11:57 AM |
word error | mac | General Discussions | 1 | May 6th, 2004 08:14 AM |
Opening Excel sheet with macro's on XP machines gives error | Dhanashree Bhat | Worksheet Functions | 0 | September 17th, 2003 07:02 AM |