Is there a registry setting to force printing gridlines, column headers for Excel 2007 on Windows XP?

0

I think I already know the answer to this ("NO!") but I thought I would reach out and hope that someone can prove me wrong.

I have a lot (tens of thousands) of Excel spreadsheets that I will be imaging (printing to TIFF) for a client. They have just added a new wrinkle to request the gridlines and the column headers on the resultant TIFFs.

Is there a way to force this from the registry? Or would it require opening each document and checking the correct boxes?

dreynold

Posted 2010-11-11T19:07:32.950

Reputation: 148

Answers

0

i do not know of any registry settings for this, but i imagine if all the documents to be printed were in a single folder it would not be too hard to handle with a macro. working example below.

Sub GridsHeaders()
    Dim FSO As Object
    Set FSO = CreateObject("Scripting.FileSystemObject")
    Dim FLS As Object, F As Object
    Dim fWB As Workbook, fSheet As Worksheet
    Dim Loc As String

    With Application.FileDialog(msoFileDialogFolderPicker)
        .Title = "Select Folder"
        .AllowMultiSelect = False
        If .Show <> -1 Then Exit Sub
        Loc = .SelectedItems(1)
    End With

    Set FLS = FSO.GetFolder(Loc).Files
    For Each F In FLS
        Loc = UCase(Mid(F.Name, InStrRev(F.Name, ".") + 1))
        If Loc = "XLS" Or Loc = "XLSX" Then
            Set fWB = Workbooks.Open(F.Path)
            For Each fSheet In fWB.Sheets
                fSheet.PageSetup.PrintGridlines = True
                fSheet.PageSetup.PrintHeadings = True
            Next fSheet
            fWB.Close True
        End If
    Next F
End Sub

Xantec

Posted 2010-11-11T19:07:32.950

Reputation: 2 303

Sadly, they are not -- these documents are being imaged for legal review, and our current process does not lend itself to moving classes of document types around the file system willy-nilly. – dreynold – 2010-11-11T19:24:58.153

i added a working example of what the macro would look like to my answer, in case it might help you. although you can not consolidate the files for a single run, it may still help if you do have more then one file per folder in places. – Xantec – 2010-11-11T19:47:21.207

Thanks for that! It gave me the crucial bit (foo.PageSetup.PrintGridlines = True) I needed to implement this in python. – dreynold – 2010-11-17T19:45:37.387