[Solved] Inserting: multipage spreadsheet into word shows 1

  • PLEASE HELP.


    I'm using a Word macro to import an Excel spreadsheet into word, using AddOLEObject.


    The problem is, the spreadsheet is wider and deeper than 1 page (maybe about 1/4 page more).
    When it is imported into Word, no matter how much I shrink the object, only the columns and rows from page 1 are displayed in Word.


    How can I get the object in Word to show all the data from the spreadsheet??


    THIS IS AN URGENT PROBLEM!
    ANY SUGGESTIONS WELCOME...


    It is not practical for me to reduce the Excel spreadsheet down to 1 page.
    I need Word to be able to display the full spreadsheet.


    NOTE: I am using Office 2000.
    And it needs to also work on Office XP (not tested yet).


    ps. I need to get the Word macro to do this. I am thinking that there must be some property or method of the object I can use...
    But any suggestions as to how to do this outside of macros may be helpful also.

  • Thank you so much for your help...boy I kind of feel dumb today. I may be able to help...just need a little time to think it through. I'll see what I can do.

  • Have you got a sample file? I could try & give it a go tomorrow. I can't promise much as i'm more XL than word....


    Sorry not to be able to offer much help.


    You can attach files of up to 1mb to your replies.


    :)

  • Hi without looking at your scripts it a little hard, but if you are using the standard object 6 excel scripts to make Word and object then you can select a range for Excel to copy over Word, and so more than one page is the result. If this is sounding what you want and you do not have code to do this, post back and I will write so coded script to try and do this for you.


    Its worth adding I have posted transfer code from Excel to Word on this forum in Excel VBA if I recall, might be worth a search if a look might help. Look uder my sign in name as I posted the code.



    Kindest possible regards



    Jack in the UK

  • Thanks for the replies.


    I've attached a test spreadsheet.


    To test it, just insert it as an object in Word (select Create From File tab).


    Then resize the object smaller.
    The 2 columns on the rightmost side are not shown.


    Jack, I'm using a very simple macro in Word, which basically just does the following:


    Selection.InlineShapes.AddOLEObject ClassType:="Excel.Sheet.8", FileName:= strName, LinkToFile:=False, DisplayAsIcon:= False
    Selection.InlineShapes(1).Height = 503.15
    Selection.InlineShapes(1).Width = 602.65


    I'm not sure what you are talking about, so if you think you can solve it, some sample code would be appreciated :)


    ----
    btw, is there a way I can speed up the AddOLEObject operation?
    It takes nearly 10 seconds!!
    And I might be adding several spreadsheets - so it can take a long time in total.


    -----
    ps.
    I'm using Word/Excel 2000 (9.0.2720)
    I'm running NT 4, SP6.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!