Solved

Hide Gridlines in Excel Object on Access form

Posted on 2006-06-10
2
291 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
ID: 16878113
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
ID: 16881959
Hey Harfang...

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

Thanks!
MikeMc
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

808 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