Jay
Tue Jul 11 15:16:19 CDT 2006
I'd advise doing all manipulation of the Excel spreadsheet in Excel --
if necessary by copying it to another .xls file and manipulating that
-- rather than trying to do anything with it once it's in Word. You
can write the macro code to do the manipulations in Excel and call
that from Word VBA, or you can automate Excel from within Word VBA
(see
http://www.word.mvps.org/FAQs/InterDev/ControlXLFromWord.htm).
Get the final result in a single Excel workbook, and then use code
like this to bring it into Word:
MyRange.InlineShapes.AddOLEObject _
FileName:="C:\TempDocuments\Book1.xls"
Note that inserted objects can't cross a page boundary, so you may
have to break up the result into several workbooks and import them
onto separate pages in Word. This command also doesn't have any
flexibility to specify particular sheets or named ranges within a
workbook -- it grabs the entire used range in the active sheet.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ:
http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
On Tue, 11 Jul 2006 09:30:39 -0800, "zSplash"
<zNOSPAMSplash@ReallygciPlease.net> wrote:
>Hi, Cindy. Thanks for the help! (...had to look up deprecated -- what a
>nice/diplomatic way to say it. :)
>
>Purpose: I have an Excel spreadsheet which I need to use in a Word
>document. I have written code to deal with the Excel spreadsheet once it's
>in Word.
>
>Sounds like you're suggesting I don't do this... What instead, please,
>Cindy??
>
>st.
>
>"Cindy M -WordMVP-" <C.Meister-C@hispeed.ch> wrote in message
>news:VA.0000c11a.006f0284@speedy...
>> Hi ZSplash,
>>
>> This uses, if I'm not mistaken, the spreadsheet converter. MS has
>> deprecated
>> this, and it's no longer distributed with Office installations. You should
>> think carefully before basing a solution on it. I don't think there's any
>> way
>> to suppress this dialog box.
>>
>> To what purpose are you opening the Excel workbook in Word?
>>
>>> I am opening an Excel spreadsheet in Word, and I want to avoid the "Open
>>> document in Workbook" dialog in which I have to select "Sheet 1." How
>>> can I
>>> avoid getting that dialog (and just open Sheet1 automatically)? (Do I
>>> modify the format (at Format:=wdOpenFormatAuto???)) (All my code is in
>>> Word, and I'm only using Excel as the repository so I can work with it in
>>> Word.)
>>>
>>> Here's the code I'm using to open the spreadsheet in Word:
>>> Application.DisplayAlerts = wdAlertsNone
>>> Documents.Open FileName:="c:\4raw.xls",
>>> ConfirmConversions:=False,
>>> ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="",
>>> PasswordTemplate:="", Revert:=False, WritePasswordDocument:="",
>>> WritePasswordTemplate:="", Format:=wdOpenFormatAuto
>>> Application.DisplayAlerts = wdAlertsAll
>>>
>>
>> Cindy Meister
>> INTER-Solutions, Switzerland
>>
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
>>
http://www.word.mvps.org
>>
>> This reply is posted in the Newsgroup; please post any follow question or
>> reply
>> in the newsgroup and not by e-mail :-)
>>
>