Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy and paste to doc
guru
After you Paste into Word, you can use APPWD.ActiveDocument.Windows(1).View.TableGridLine s = False to hide the gridlines. -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "guru" wrote in message ... I am using the next code in order to copy a range from a sheet to a word document The problem is that this copy takes the gridlines from the sheet and creates tables in word document . How can i prevent the gridlines not to be paste in the doc.? Sub wordexport() Worksheets("PRAKTIKO_ISOL").Select ''''''CREATE WORD and copy range to it Application.CutCopyMode = xlCut Application.DisplayAlerts = False On Error Resume Next Dim APPWD As Object Dim finalrow As Long Dim i As Integer Set APPWD = CreateObject("Word.Application") APPWD.Visible = True Sheets("PRAKTIKO_ISOL").Select 'Find the last row with data in the database finalrow = Range("A9999").End(xlUp).Row Range(Cells(1, 1), Cells(finalrow, 5)).Copy ' Tell Word to create a new document APPWD.Documents.Add ' Tell Word to paste the contents of the clipboard into the new document APPWD.Selection.Paste Application.CutCopyMode = xlCut ''''' fix document margins With APPWD.ActiveDocument.PageSetup .LineNumbering.Active = False .LeftMargin = Application.InchesToPoints(1) .RightMargin = Application.InchesToPoints(1) .TopMargin = Application.InchesToPoints(1) .BottomMargin = Application.InchesToPoints(1) .HeaderMargin = Application.InchesToPoints(1.25) .FooterMargin = Application.InchesToPoints(1.25) End With Application.DisplayAlerts = True End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can't Copy and Paste or Paste Special between Excel Workbooks | Excel Discussion (Misc queries) | |||
Copy, paste without file name referenced after paste | Excel Discussion (Misc queries) | |||
Copy; Paste; Paste Special are disabled | Excel Discussion (Misc queries) | |||
Excel cut/Paste Problem: Year changes after data is copy and paste | Excel Discussion (Misc queries) | |||
I cannot paste from one workbook to another. Copy works, paste do. | Excel Discussion (Misc queries) |