LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel Automation - Gridlines

I am trying to manipulate an Excel file from within Access. When the
file is printed out I want either gridlines or to turn gridlines off.
What I'm getting is some columns have gridlines off and most have them
on.

My code is below, does anyone have any ideas?

Here's the code having to do with formating the sheet which is created
one line ahead with an outputto statement:

Set oApp = CreateObject("Excel.Application")
Set oExcel = oApp.Workbooks.Open(Filename:=mPathAndFile)


oApp.Visible = False
oApp.DisplayAlerts = False
oExcel.Worksheets("compliance export qry").Activate


With oExcel.Worksheets("compliance export qry").Columns


..Columns("A:S").AutoFit


End With


'set cells white


Columns("A:V").Select


With Selection.Interior
..ColorIndex = 2
..Pattern = xlSolid
..PatternColorIndex = xlAutomatic


End With


With oExcel.Worksheets("compliance export qry").PageSetup
..Zoom = False
..FitToPagesTall = 1000
..FitToPagesWide = 1
..Orientation = xlLandscape
..PrintGridlines = False
..PrintTitleRows = "A1:S1"
'.LeftHeader =
..CenterHeader = "&14" & pFilename & "&10"
'.RightHeader =
..LeftFooter = "Report Created &D &T"
'.CenterFooter =
..RightFooter = "Page &P of &N"


..LeftMargin = oApp.InchesToPoints(0.25)
..RightMargin = oApp.InchesToPoints(0.25)
..TopMargin = oApp.InchesToPoints(0.75)
..BottomMargin = oApp.InchesToPoints(0.5)
..HeaderMargin = oApp.InchesToPoints(0.5)
..FooterMargin = oApp.InchesToPoints(0.25)


End With


With oExcel.Worksheets("compliance export qry").Range("A1:S1")


..Font.ColorIndex = 1
..Font.Bold = True


End With


Set oSheet = Nothing 'disconnect from the Worksheet
oExcel.Close SaveChanges:=True 'Save (and disconnect from) the
Workbook


Set oExcel = Nothing
oApp.Quit 'Close (and disconnect from) Excel
Set oApp = Nothing

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gridlines are there, then Custom View, gridlines disappear in xl 2 Winnipeg Michael Excel Discussion (Misc queries) 0 September 15th 08 06:04 PM
excel 3 gridlines. RayW Excel Worksheet Functions 1 December 1st 07 08:17 PM
gridlines in excel aoxee Excel Discussion (Misc queries) 1 July 12th 07 07:43 PM
Row colors overlay the gridlines...how do I show gridlines? RickToo11 Excel Discussion (Misc queries) 2 September 13th 06 03:46 PM
In Excel, gridlines won't print--File,PageSetup,Sheet,Gridlines-- 4most New Users to Excel 3 July 9th 06 01:45 AM


All times are GMT +1. The time now is 09:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"