[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Hide Gridlines in Excel Object on Access form

Posted on 2006-06-10
2
Medium Priority
?
323 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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

656 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