Solved

VB.Net, Office, #$%^&@ Constants

Posted on 2004-04-20
3
1,107 Views
Last Modified: 2012-06-22
Where do I get a listing of what the values are for Excel and Word constants that were perfectly legitimate (or at least some were) in VB 6 but seemed to have disappeared off the face of the planet for VB.NET

For example

   
    With objWS.Range("A1:M1")
        .HorizontalAlignment = xlLeft
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = True
    End With

I need to find values for xlLeft, xlCenter, xlRight, xlBottom, xlContext, ad. nausum.

Thanks,
K
0
Comment
Question by:Knomaze
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
malharone earned 250 total points
Comment Utility
you've to explicitely refer to them using the Excel namespace.

eg.

worksheet.Range("A1:M1").VerticalAlignment = Excel.Constants.xlBottom
0
 
LVL 9

Expert Comment

by:malharone
Comment Utility
if you can't find the enum/constant in Excel.Constants namespace,
the easiest way to locate them is go to Excel, Tools > Macros > VB Editor.
In the VBA, press F2 (or view > object browser) and enter the name of the constant and search for it. it'll list LIBRARY and CLASS columns. Use them as a namespace.
0
 

Author Comment

by:Knomaze
Comment Utility
I was about to update the question that I FINALLY found the name space in the object browser with all the constants declared but then needed to know how I referenced it. This is exactly what I was looking for.

Thank-you,
K
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

13 Experts available now in Live!

Get 1:1 Help Now