Size of excel OLE object inserted using Visual Basic.

eudaemon

New Member
Joined
Nov 30, 2009
Messages
2
Greetings,
I am currently using automation to insert an excel 2007 file into a Word 2007 document using VB 6. My goal is to make the OLE window show the entire excel document (which has a chart along with cells that contain header information) in the word document. Currently, when I call AddOLEObject to insert the excel file into the Shapes of the Word document, only the first couple of rows are visible, I know that it needs to be sized to show columns a,b,c and down to row 46 but it only shows columns a,b,c down to row 6. I've tried changing the width and height of the OLE window but that just distorts the first 6 rows instead of showing more of the excel worksheet.

Do I need to select the cells in some way to make sure the full chart and headers all show up? Using this same program, Excel 2000 and Word 2000 would show the entire worksheet without having to do anything, as more information was added the OLE window would just expand to make sure the columns were visible, but in Excel 2007 it seems to have a 'default' size when the excel file is first inserted and putting more information into the cells does not seem to force it to expand at all.

Anyone have any ideas?
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Sorry about bumping this up but looking around this seems to be a common problem (resizing an OLE container), I've found 4 or 5 other threads with this exact problem described but no one ever replied. Is there another method I should be using to embed this Excel file maybe? Resizing the OLE container seemed to work in the past (with other versions of Excel and Word) and I'm just confused by how hard it has been to perform what should be a simple function.
 
Upvote 0

Forum statistics

Threads
1,215,350
Messages
6,124,431
Members
449,158
Latest member
burk0007

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top