View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Patrick Dave Patrick is offline
external usenet poster
 
Posts: 249
Default Word VBA link to Excel

Option Explicit
Dim filePath, oExcel, oSheet
filePath = "c:\Test.xls"
Set oExcel = CreateObject("Excel.Application")
oExcel.Workbooks.Open(filepath)
Set oSheet = oExcel.ActiveWorkbook.Worksheets(1)
oSheet.Name = "sheet1"
MsgBox oSheet.Cells(1, 1)
oExcel.DisplayAlerts = False
oExcel.ActiveWorkbook.Close
oExcel.Quit
set oSheet = Nothing
Set oExcel = Nothing

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Borg" wrote:
|
| In MS Word, I wanted to create a VBA macro code to link to a specific
| cell of text from Excel, but to break the link after the data is
| inserted from Excel.
|
| I would appreciate any help.
|
| I have been able to do this in Excel, but unable to do so with Word.
|
|
| --
| Borg
| ------------------------------------------------------------------------
| Borg's Profile:
http://www.excelforum.com/member.php...o&userid=36396
| View this thread: http://www.excelforum.com/showthread...hreadid=561797
|