Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Imbed an Excel Sheet in a Word Doc W/OUT Every Excel Grid Visible 2

Status
Not open for further replies.

ProtocolPirate

Programmer
Nov 21, 2007
104
US
When imbedded in a Word document, all of the worksheet grid lines with no border appear in gray, rather than blank as they should.

What a useful feature!! Thank you so much Microsoft... Can I salvage this, or am I going to have to convert this to a PDF and import that instead?
 
It is the default way excel displays worksheet.
Edit embeded workbook, in Tools>Options>View tab untick 'gridlines'.

combo
 
I know how to turn off gridlines for an Excel object in VB.NET by running oXL.ActiveWindow.DisplayGridlines = False, but how do you get the oXL object for a spreadsheet that you have just imbedded in a Word document using AddOLEObject? I need to be able to imbed an Excel spreadsheet in a Word document and turn off the gridlines to print a report.
 
In VBA:
Code:
Dim wdOLEFormat As Word.OLEFormat
Set wdOLEFormat = ThisDocument.InlineShapes(1).OLEFormat
' replace 'ThisDocument' by document reference if code
' is outside processed document
wdOLEFormat.DoVerb wdOLEVerbDiscardUndoState
' or ...DoVerb -6 (&HFFFFFFFA) for late binding
With wdOLEFormat.Object
    .Windows(1).DisplayGridLines = False
End With

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top