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
Solved

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

Posted on 2004-04-20
3
1,143 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
ID: 10872369
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
ID: 10872406
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
ID: 10872686
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

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