LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Inserting Excel OLE Object

Hi,

I saw an example in this forum to push changes from Excel to Word, and
modified it slightly to inste excel table(OLE tables) from Excel to Word. I
can get it work for inserting the entire table, but would it be possible to
insert just a portion of the table? i.e. i have a huge spreadsheet, but I
want to display just the first two columns in Word....

Thanks you for the response.

Aga

Here is my code from Excel

Public Sub rnn()
Dim rng As Object
Dim wdApp As Object
Set wdApp = CreateObject("Word.Application")

Dim wddoc As Object
Set wddoc = wdApp.Documents.Add("c:\del.doc")

Dim bkMark As Object
Dim bkMarks As Object
Set bkMarks = wddoc.Bookmarks
For Each bkMark In bkMarks
Debug.Print bkMark.Name
If (bkMark.Name = "img_bk") Then
Set rng = bkMark.Range
End If
Next bkMark



' rng.InlineShapes.AddPicture
"C:\Projects\VisualScreen_2BETA\Code\vs_logo.j pg", , , rng
rng.InlineShapes.AddOLEObject , "c:\someexcel.xml", , , , , , rng

wddoc.SaveAs "c:\del_modified.doc"
wddoc.Close

Set wddoc = Nothing
Set wdApp = Nothing

End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting a MS Word object into an Excel spreadsheet (2 questions) Phrank Excel Worksheet Functions 1 December 28th 07 02:22 PM
Issues inserting wide Word object into Excel kar Excel Discussion (Misc queries) 0 November 30th 07 10:10 AM
inserting an object in Excel LK Excel Programming 1 April 29th 04 09:25 PM
Inserting an Object in Excel L. Keitelman Excel Programming 0 April 29th 04 08:12 PM
Inserting Object in Excel Footer Bob N. Betts Excel Programming 2 November 7th 03 03:05 AM


All times are GMT +1. The time now is 06:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"