DeepUnderground
07-26-2010, 06:42 PM
I have the following code:
Sub ClearEntireVerticalDistributionTable_FormattingOFF(ByVal mysheet As Worksheet)
Dim doc As Word.Document
Set doc = mysheet.OLEObjects(2).Object
mysheet.Range(Cell_2000).MergeArea.ClearContents
mysheet.Range(Cell_2000).MergeArea.Locked = True
With mysheet.Range("$B$14:$Y$123")
.ClearContents
.Interior.ColorIndex = xlNone
.Borders.LineStyle = xlNone
.Locked = True
End With
doc.Visible = False '<<<<<<<<<<<<<<<<< this gives an error
mysheet.PageSetup.PrintArea = "$B$2:$Y$62"
End Sub
doc.Visible = False gives an error. Does anyone know of a good way to hide word docs in excel. It doesn't work quite like a text box..
Sub ClearEntireVerticalDistributionTable_FormattingOFF(ByVal mysheet As Worksheet)
Dim doc As Word.Document
Set doc = mysheet.OLEObjects(2).Object
mysheet.Range(Cell_2000).MergeArea.ClearContents
mysheet.Range(Cell_2000).MergeArea.Locked = True
With mysheet.Range("$B$14:$Y$123")
.ClearContents
.Interior.ColorIndex = xlNone
.Borders.LineStyle = xlNone
.Locked = True
End With
doc.Visible = False '<<<<<<<<<<<<<<<<< this gives an error
mysheet.PageSetup.PrintArea = "$B$2:$Y$62"
End Sub
doc.Visible = False gives an error. Does anyone know of a good way to hide word docs in excel. It doesn't work quite like a text box..