Solved

Hide Gridlines in Excel Object on Access form

Posted on 2006-06-10
2
299 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
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…

733 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