Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 10-23-2011, 05:11 AM
macropod's Avatar
macropod macropod is offline Is it possilble to transfer data from Excel to Publisher? Windows 7 64bit Is it possilble to transfer data from Excel to Publisher? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Mark,

That's rather like asking: how long is a piece of string? It all depends on your familiarity with vba, using vba to automate Office apps, and the Publisher Object Model.

FWIW, here's some code showing how you might update a Word document from Excel. The code copies Range "A1:J10" on the first worksheet as an OLE object to a bookmark named "xlTbl" in a Word document named "C:\My Documents\MyFile.doc", and leaves the document active & visible:
Code:
Sub SendRangeToDoc()
Dim wdApp As Word.Application, WdDoc As String
'Copy range
ActiveWorkbook.Sheets(1).Range("A1:J10").Copy
'Establish link to Word
WdDoc = "C:\My Documents\MyFile.doc"
If Dir(WdDoc) <> "" Then
  Set wdApp = New Word.Application
  wdApp.Visible = True
  With wdApp
    'open the Word Document
    Documents.Open Filename:=WdDoc
    Dim BmkNm As String
    BmkNm = "xlTbl"
    With ActiveDocument
      If .Bookmarks.Exists(BmkNm) Then
        .Bookmarks(BmkNm).Range.PasteSpecial Link:=False, DataType:=wdPasteOLEObject, _
        Placement:=wdInLine, DisplayAsIcon:=False
        .Save
      Else
        MsgBox "Bookmark: " & BmkNm & " not found."
      End If
    End With
  End With
Else
  MsgBox "File: " & WdDoc & " not found."
End If
Set wdApp = Nothing
End Sub
For Publisher, the approach would be similar. See also:
http://msdn.microsoft.com/en-us/office/aa905474.aspx
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possilble to transfer data from Excel to Publisher? Wine List, Data Merge - Excel to Publisher - Or other suggestions? daym Publisher 2 05-01-2011 03:45 AM
Is it possilble to transfer data from Excel to Publisher? Transfer Outlook info to Excel methedr Outlook 1 05-24-2010 05:48 AM
How to transfer Word 2003 Tables to Excel? steeleye Word Tables 1 07-10-2009 04:18 PM
Is it possilble to transfer data from Excel to Publisher? How to transfer multiple cells from excel to word by formulas justziggy Word 5 05-23-2009 02:33 AM
TRANSFER DATA TO NEW WORKSHEET BOBN Excel 0 11-08-2007 10:34 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:16 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