Solved

Hide Gridlines in Excel Object on Access form

Posted on 2006-06-10
2
277 Views
Last Modified: 2012-08-13
Hello,

I am trying to format an excel object that I have embedded in an Access form.  I have included the Microsoft Excel Lib as a reference to my project.  

Most of the standard Excel formatting commands work.  For example,        
      objXL.worksheets(1).Columns(7).NumberFormat = "$#,##0"
works fine for formatting a column to currency.

I can't seem to get the gridlines to turn off.  The standard Excel command is
    ActiveWindow.DisplayGridlines = False
Which returns the error: "Object variable or WIth block variable not set"

I've tried a few different iterations:
   objXL.worksheets(1).DisplayGridlines = False
   objXL.worksheets(1).ActiveWindow.DisplayGridlines = False
but none of them worked.

Any help would be greatly appreciated.

Thanks!
MikeMc

   
0
Comment
Question by:cdmac2
2 Comments
 
LVL 58

Accepted Solution

by:
harfang earned 500 total points
Comment Utility
Hello cdmac2

If objXL is a workbook (looks like it), you can use one of:

    objXL.Windows(1).DisplayGridlines = False
    objXL.Application.ActiveWindow.DisplayGridlines = False

Cheers!
(°v°)
0
 
LVL 1

Author Comment

by:cdmac2
Comment Utility
Hey Harfang...

Sorry for the delayed response.  The first one you suggested did the trick.

Thanks!
MikeMc
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now