I am pasting a range into a word document from an excel range after running autofilter (from VBA) on the range.
This works fine on one computer with Word 10.0 Object Library, and creates a 37 KB word document; however, on another computer with Word 9.0 Object Library, it creates a 1.5 MB file, and takes too long; perhaps it is copying all the data into the word document somewhere, not just the visible rows? Other ranges pasted this way (without using autofilter) are small in size. Any suggestions that will eliminate this? ... DataType or Link? Or perhaps an alternate way from autofilter to extract a range of data from a table that is added to daily. (The selection is by TWO column values for a varying number of resulting rows.)
Code:
Worksheets("Sheet1").Range("YourExcelrange").AutoFilter Field:=2, Criteria1:=chosenValue
YourExcelrange.Copy
YourWordDocument.Bookmarks("YourBokmark").Range.PasteSpecial
This works fine on one computer with Word 10.0 Object Library, and creates a 37 KB word document; however, on another computer with Word 9.0 Object Library, it creates a 1.5 MB file, and takes too long; perhaps it is copying all the data into the word document somewhere, not just the visible rows? Other ranges pasted this way (without using autofilter) are small in size. Any suggestions that will eliminate this? ... DataType or Link? Or perhaps an alternate way from autofilter to extract a range of data from a table that is added to daily. (The selection is by TWO column values for a varying number of resulting rows.)