
Sub Copia()
'
Sheets("Cali").Unprotect 'Rimuove protezione del foglio specificato
Columns("U:AD").Select
Selection.EntireColumn.Hidden = False
Sheets("Cali").Range("U14:AC20").Select
'Selection.CopyPicture
Selection.Copy
Set WordApp = CreateObject("Word.Application")
sFilename = "F:4 Google DriveGESTIONE20141 Litri.doc"
WordApp.Visible = True
With WordApp.Documents.Open(sFilename)
'.Paragraphs.last.Range.Paste
.Paragraphs.first.Range.Paste
Worksheets("Cali").Activate
Columns("U:AC").Select
Selection.EntireColumn.Hidden = True
Range("B2").Select
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows _
:=True, AllowInsertingHyperlinks:=True, AllowDeletingColumns:=True, _
AllowDeletingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
AllowUsingPivotTables:=True
ActiveSheet.EnableSelection = xlUnlockedCells 'se attiva non seleziona le celle bloccate
End With
Set WordApp = Nothing
End Sub |
Sub Copia()
'
Set WordApp = CreateObject("Word.Application")
sFilename = "F:4 Google DriveGESTIONE20141 Litri.doc"
WordApp.Visible = True
With WordApp.Documents.Open(sFilename)
Sheets("Cali").Unprotect 'Rimuove protezione del foglio specificato
Columns("U:AD").Select
Selection.EntireColumn.Hidden = False
Sheets("Cali").Range("U14:AC20").Select
'Selection.CopyPicture
Selection.Copy
'.Paragraphs.last.Range.Paste
.Paragraphs.first.Range.Paste
Worksheets("Cali").Activate
Columns("U:AC").Select
Selection.EntireColumn.Hidden = True
Range("B2").Select
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows _
:=True, AllowInsertingHyperlinks:=True, AllowDeletingColumns:=True, _
AllowDeletingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
AllowUsingPivotTables:=True
ActiveSheet.EnableSelection = xlUnlockedCells 'se attiva non seleziona le celle bloccate
End With
Set WordApp = Nothing
End Sub |
