PDA

Click to See Complete Forum and Search --> : Copy/Paste from Excel to Word


age88220
Sep 23rd, 2005, 03:21 PM
Thanks in advance for any help ...

Have code that creates a Workbook with 2 worksheets based on user input. The 2 sheets are Input and Output. From the Output worksheet, a certain range for a certain year (within each year, each quartile) is copied and pasted into Word as a metafile. Oddly enough, only the year 2000 is skipped and not copied into MS Word as a metafile and can't figure out why. Code is kinda long, so is attached.

Any assistance, well appreciated.

RobDog888
Sep 23rd, 2005, 03:35 PM
Thats allot of code to go through but good for referencing your issue. Could you place a breakpoint at the "Do While Year < 2005" line and run it through until the Year is 2000. Then step through the code and see if it skips any loops or generates any unseen errors.

age88220
Sep 29th, 2005, 09:17 AM
RobDogg -

Stepped through the code and I think what is happening is this - I have defined a maximum number of records (rows) to be pasted as a metafile in Word as this is generally the optimum number of records to be displayed per page. But when the returned records are greater than the max defined, Word isn't sure what to do with them so it skips and continues with the loop.

So I'm wondering if there is a way to set a condition wherein if the number of returned records are greater than the maximum defined, the pasted metafile is proportionally re-sized to fit on one page.

Thanks again for any assistance.