Solved

Formatting Excel from VB code.

Posted on 2010-08-17
22
1,293 Views
Last Modified: 2012-05-10
I'm trying to generate an Excel spreadsheet from within a VB6 application

1. Private Sub cmdExcel_Click()
2. Dim XL As Object
3. Set XL = CreateObject("Excel.Application")
4. XL.Visible = True
5. XL.Workbooks.Add
6. XL.Range("b1") = "test"
7. XL.Range("b2:b4") = 99
8. XL.Range("b1:b100").Select
9. XL.ActiveCell.ColumnWidth = 20
10. XL.ActiveCell.Font = "Bold"
11. End Sub

(lines numbered for reference here)

This little sub works up to line 9.
Line 10 syntax is incorrect.

My question is in three parts:

Is there a neater way to specify a column than line 8? Just "b" doesn't work.

Line 9: What is the correct syntax to format a cell, or a range of cells?
I am specifically interested in bolding (or not), and centering.

Does the selection in line 8 hold for succeeding statements until another range is selected?

I appreciate any help.

0
Comment
Question by:NormaPosy
  • 9
  • 7
  • 5
  • +1
22 Comments
 
LVL 3

Expert Comment

by:celdridgeMadman
Comment Utility
Try changing it to

XL.ActiveCell.Font.Bold = True
0
 
LVL 24

Expert Comment

by:StephenJR
Comment Utility
Just expanding on previous post. You don't need to select.
Private Sub cmdExcel_Click()

Dim XL As Object

Set XL = CreateObject("Excel.Application")

With XL
    .Visible = True
    .Workbooks.Add
    .Range("b1") = "test"
    .Range("b2:b4") = 99
    With .Range("B1").EntireColumn ' Or Columns(2) Or Range("B:B")
        .ColumnWidth = 20
        .Font.Bold = True
        .HorizontalAlignment = xlCenter
    End With
End With

End Sub

Open in new window

0
 
LVL 11

Expert Comment

by:kbirecki
Comment Utility
One way to find correct syntax is to use Excel's built-in feature to record a macro, then look at that code.  This will also point out ways to do what you asked and the other two people answered.  Just record yourself doing what you want, then review the code Excel generates because often it has extraneous stuff you won't need for automation.
0
 

Author Comment

by:NormaPosy
Comment Utility
StephenJR:
Line 15: MsgBox: "Unable to set the HorizontalAlignment property of the Range class.

kbirecki:
Good idea, and I thought of that too. Tried it. Here is the macro:
(I didn't copy all the other attbutes here).

Columns("B:B").Select
    With Selection
        .HorizontalAlignment = xlCenter
    End With

Couldn't get that to work either.

I think where I am confused is: Theres a difference between a "range" and a "selection". and some things apply to one, and some things to the other.
0
 
LVL 24

Expert Comment

by:StephenJR
Comment Utility
Works for me. Where have you put this code? You scarcely ever need to select anything, it's inefficient and better to refer to the range directly rather than selecting then doing something. Columns("B:B") is not proper syntax.
0
 
LVL 24

Expert Comment

by:StephenJR
Comment Utility
There may be some random weirdness around horizontal alignment: http://www.ozgrid.com/forum/showthread.php?t=11626&page=1
0
 
LVL 11

Expert Comment

by:kbirecki
Comment Utility
NormaPosy, I'm not sure if you were abreviating, but macros that Excel records work "in" Excel, where outside Excel (i.e. from VB6), you have to include your object reference and make your calls using that object reference.  I didn't mean to imply you could just copy and paste.  You have to add a reference to Excel in fron tof all the stmts from the Excel macro.  Also, I assume you had xlCenter defined somewhere, right?

Anyway, here's a working example, albeit modified from your code with a generic routine that I use to connect to Excel.  I placed this on a form module with a button named "Command1".  Open your Excel workbook and run this project in VB6, click the button and it will center column B.

(fyi: StephenJR - .Columns("B:B") is valid when used in the right circumstance.)
Private oXL As Object



'---Sample routine here---

Private Sub Command1_Click()



Dim lXL As Boolean

Const xlCenter = -4108



lXL = OpenExcel



If lXL Then

    With oXL

        .Columns("B:B").Select

        With .Selection

            .HorizontalAlignment = xlCenter

        End With

    End With

Else

    MsgBox "Unable to connect to Excel"

End If



End Sub

'---Sample routine here---





'---Generic routine here, could be placed in a module---

Function OpenExcel() As Boolean

    ' Comments  : This is the first routine to call to instantiate a reference to Excel.

    '             This routine simply opens Excel and assigns a reference to it the variable oXL.

    ' Parameters: None

    ' Returns   : Boolean - True = Excel was successfully opened; False if not.

    ' Modified  :

    '

    ' --------------------------------------------------



    'USAGE: This routine assigns an object reference to te variable oXL.

    'Simply call this routine to assign a reference to oXL (define at the top of this module).

    'Then use 'oXL' in calls to other routines in this module or anywhere you need an Excel reference.

    

    On Error Resume Next



    Err.Clear

    Set oXL = GetObject(, "Excel.Application")

    If Err > 0 Then

        'MsgBox "Excel is busy or not running."

        Err.Clear

        ExcelWasNotRunning = True

        Set oXL = CreateObject("Excel.Application")

        If Err > 0 Then

            OpenExcel = False

        Else

            oXL.Visible = True

            OpenExcel = True

        End If

    Else

        oXL.Visible = True

        ExcelWasNotRunning = False

        'AppActivate "Microsoft Excel"

        OpenExcel = True

    End If



End Function

'---Generic routine here, could be placed in a module---

Open in new window

0
 
LVL 11

Expert Comment

by:kbirecki
Comment Utility
I wish I could edit posts I submitted.... Anyway, I forgot that I was going to add that I think StephenJR is correct about it being better to use a range instead of a selection.  I stuck with a selection because that is what you had in your example.
0
 
LVL 24

Expert Comment

by:StephenJR
Comment Utility
kbirecki: I stand corrected.
0
 

Author Comment

by:NormaPosy
Comment Utility
If it matters: My Excel is: Excel 2003 (11.5612.5606) -- and using  VB6 under XP

All of the other formatting that can be assigned to cells seems to work here.
Not horizontal alignment. If this is something peculiar to the specific combination of stuff on my machine, then there is no point in creating an app for general distribution, even if I got it somehow to work here.

I looked at Stephen's link with considerable interest.
Apparently, this is a common difficulty.
If it can't be done, it can't be done.
0
 
LVL 11

Expert Comment

by:kbirecki
Comment Utility
I don't think it is specific to that version of Excel and OS.  I have tried my example on XP and Win Server 2003 also using Excel 2003, but also Execl 2007.  I'm attaching my project code and EXE.  Try this and tell me what you get.
ExcelTest.zip
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 11

Expert Comment

by:kbirecki
Comment Utility
I just looked at the link that StephenJR posted, and without further analysis, I'm guessing that poster is having a scoping issue.  There are some things you can't do from various events until the target of action is ready.
0
 

Author Comment

by:NormaPosy
Comment Utility
Line 13: Error 1004.
Application-defined or object defined error.

I'm starting to feel bad about absorbing both of your times over this.
0
 
LVL 24

Expert Comment

by:StephenJR
Comment Utility
Don't worry, I've reached the extent of my knowledge of this. VB6 is beyond my ken, but sounds like kbirecki may have further tricks up his/her sleeve...
0
 
LVL 11

Expert Comment

by:kbirecki
Comment Utility
Norma, did you try my sample and get this?
"Line 13: Error 1004.
Application-defined or object defined error."
I'm happy to help.  I've found lots of help here so I'm happy to pay it forward.  I do have a good amount of experience with VB6, and automating Excel.  Let's keep moving forward if you're willing.

I think if you are getting that error from my sample, there is something different about your environment from mine.  Please confirm if that is what you meant.  We'll figure it out.
-Ken
0
 

Author Comment

by:NormaPosy
Comment Utility
Yes. That refers to line 13 in your code.
.Columns("B:B").Select
0
 
LVL 11

Expert Comment

by:kbirecki
Comment Utility
OK, let's start here. I always find it best to solve problems starting with "plain vanilla".

1) My program assumed an existing spreadsheet is already opened in Excel. (I have a different routine I use to actually open an Excel file if you're interested, but let's check these basics first.)  It does not even have to be saved as a file at this point. Because we're trying to center column B, place some text in Col B that is not centered and move off that cell (we don't want to be "currently editing" the cell; Excel won't be able to respond to anything until that is completed.)

2) [In this step, we're checking if the sample program thinks it is successfully connecting to Excel.] We need to verify you are getting a connection to Excel. Open the sample I created in VB6 and put a break point on the line after lXL = OpenExcel; in my example it is the line "If lXL then". Run the program, click the btn, and when it stops, switch to the debug window (CTRL-G), and type "? lXL" without the quotes and press . I should return True. If not, we need to troubleshoot this step. Let me know.

3) [In this next step, we're checking to see if you actually did get a successful connection to Excel.] If you get True in the last step, press twice to step over the lines:

     If lXL Then
          With oXL

You should be on the line "Columns("B:B").Select". Again switch to the debug window (CTRL-G), and type "? oXL.name" (actually in this case you can just type "? oXL" since they both work the same.) You should get a response of "Microsoft Excel". If you do not, stop here, we need to troubleshoot why it is not connecting to Excel correctly.
4) If you are successful to this point, press <F8> once more and column B should then be centered.  Check that it is.
If you successfully completed up to step 4, press <F5> to let the app finish.

Please let me know your results from these steps.
0
 

Author Comment

by:NormaPosy
Comment Utility
OK. With no Excel already open, your program bombs at "Columns("B:B").Select" line.

If I first open Excel, then your program runs fine. It connects to the existing spreadsheet.

If I go there and manually type anything into column B, it is centered.

I am now going to go back to my project and parallel the steps you outlined, above.
Seems strange, though, that it does everything else, and creates a very nice spreadsheet.

Maybe I will come back and post the code here. It's not very lengthy.
0
 

Author Comment

by:NormaPosy
Comment Utility
Private Sub cmdMakeSpreadsheet_Click()

Dim XL As Object
Set XL = CreateObject("Excel.Application")

With XL
    .Visible = True
    .Workbooks.Add
    With .Range("A1:F200")
        .ColumnWidth = 18
        .Font.Name = "Courier New"
        .Font.Size = 10


‘ ** bombs here.
‘ If I comment this line out, rest of it runs fine.
        .HorizontalAlignment = xlCenter
    End With
    With .Range("A1:A2")
        .Font.Bold = True
    End With
'
' HEADERS
'
    .Range("A1").Value = txtHeader(0).Text
    .Range("A2").Value = txtHeader(1).Text

‘ - - - etc

End With ' XL

End Sub
0
 
LVL 11

Accepted Solution

by:
kbirecki earned 500 total points
Comment Utility
If it helps your sanity, I was able to reproduce the error you reported with regards to setting HorizontalAlignment, but only when I used your code exactly as you have it.  I am guessing that you don't have any Excel constants defined, right?

VB6 knows nothing about Excel constants like "xl...",  You have to add them explicitly in the subroutine or as public constants in a shared module so you don't have to repeat them.  Do this:

1) add the line "const xlCenter = -4108" near the beginning of your routine.  Then try again.  I'm not a betting person, but I'll bet it works this time.

2) for the future, create a module called something like "basExcelFunctions" and put the code below in it as a starting point for your own Excel library, and then include that module anytime you need excel functions.  (If you use this, remove the local const declaration.)

Public Const xl24HourClock = 33

Public Const xl3DArea = -4098

Public Const xl3DAreaStacked = 78

Public Const xl3DAreaStacked100 = 79

Public Const xl3DBar = -4099

Public Const xl3DBarClustered = 60

Public Const xl3DBarStacked = 61

Public Const xl3DBarStacked100 = 62

Public Const xl3DColumn = -4100

Public Const xl3DColumnClustered = 54

Public Const xl3DColumnStacked = 55

Public Const xl3DColumnStacked100 = 56

Public Const xl3DEffects1 = 13

Public Const xl3DEffects2 = 14

Public Const xl3DLine = -4101

Public Const xl3DPie = -4102

Public Const xl3DPieExploded = 70

Public Const xl3DSurface = -4103

Public Const xl4DigitYears = 43

Public Const xlA1 = 1

Public Const xlAbove = 0

Public Const xlAbsolute = 1

Public Const xlAbsRowRelColumn = 2

Public Const xlAccounting1 = 4

Public Const xlAccounting2 = 5

Public Const xlAccounting3 = 6

Public Const xlAccounting4 = 17

Public Const xlAdd = 2

Public Const xlAddIn = 18

Public Const xlAll = -4104

Public Const xlAllAtOnce = 2

Public Const xlAllChanges = 2

Public Const xlAllExceptBorders = 6

Public Const xlAllFaces = 7

Public Const xlAlternateArraySeparator = 16

Public Const xlAnd = 1

Public Const xlAnyGallery = 23

Public Const xlArea = 1

Public Const xlAreaStacked = 76

Public Const xlAreaStacked100 = 77

Public Const xlArrangeStyleCascade = 7

Public Const xlArrangeStyleHorizontal = -4128

Public Const xlArrangeStyleTiled = 1

Public Const xlArrangeStyleVertical = -4166

Public Const xlArrowHeadLengthLong = 3

Public Const xlArrowHeadLengthMedium = -4138

Public Const xlArrowHeadLengthShort = 1

Public Const xlArrowHeadStyleClosed = 3

Public Const xlArrowHeadStyleDoubleClosed = 5

Public Const xlArrowHeadStyleDoubleOpen = 4

Public Const xlArrowHeadStyleNone = -4142

Public Const xlArrowHeadStyleOpen = 2

Public Const xlArrowHeadWidthMedium = -4138

Public Const xlArrowHeadWidthNarrow = 1

Public Const xlArrowHeadWidthWide = 3

Public Const xlAscending = 1

Public Const xlAutoActivate = 3

Public Const xlAutoClose = 2

Public Const xlAutoDeactivate = 4

Public Const xlAutoFill = 4

Public Const xlAutomatic = -4105

Public Const xlAutomaticScale = -4105

Public Const xlAutomaticUpdate = 4

Public Const xlAutoOpen = 1

Public Const xlAverage = -4106

Public Const xlAxis = 21

Public Const xlAxisCrossesAutomatic = -4105

Public Const xlAxisCrossesCustom = -4114

Public Const xlAxisCrossesMaximum = 2

Public Const xlAxisCrossesMinimum = 4

Public Const xlAxisTitle = 17

Public Const xlBackgroundAutomatic = -4105

Public Const xlBackgroundOpaque = 3

Public Const xlBackgroundTransparent = 2

Public Const xlBar = 2

Public Const xlBarClustered = 57

Public Const xlBarOfPie = 71

Public Const xlBarStacked = 58

Public Const xlBarStacked100 = 59

Public Const xlBelow = 1

Public Const xlBetween = 1

Public Const xlBidi = -5000

Public Const xlBidiCalendar = 3

Public Const xlBIFF = 2

Public Const xlBitmap = 2

Public Const xlBlanks = 4

Public Const xlBMP = 1

Public Const xlBoth = 1

Public Const xlBottom = -4107

Public Const xlBottom10Items = 4

Public Const xlBottom10Percent = 6

Public Const xlBox = 0

Public Const xlBubble = 15

Public Const xlBubble3DEffect = 87

Public Const xlBuiltIn = 21

Public Const xlButton = 15

Public Const xlButtonControl = 0

Public Const xlByColumns = 2

Public Const xlByRows = 1

Public Const xlCalculationAutomatic = -4105

Public Const xlCalculationManual = -4135

Public Const xlCalculationSemiautomatic = 2

Public Const xlCancel = 1

Public Const xlCap = 1

Public Const xlCascade = 7

Public Const xlCategory = 1

Public Const xlCategoryScale = 2

Public Const xlCellTypeAllFormatConditions = -4172

Public Const xlCellTypeAllValidation = -4174

Public Const xlCellTypeBlanks = 4

Public Const xlCellTypeComments = -4144

Public Const xlCellTypeConstants = 2

Public Const xlCellTypeFormulas = -4123

Public Const xlCellTypeLastCell = 11

Public Const xlCellTypeSameFormatConditions = -4173

Public Const xlCellTypeSameValidation = -4175

Public Const xlCellTypeVisible = 12

Public Const xlCellValue = 1

Public Const xlCenter = -4108

Public Const xlCenterAcrossSelection = 7

Public Const xlCGM = 7

Public Const xlChangeAttributes = 6

Public Const xlChart = -4109

Public Const xlChart4 = 2

Public Const xlChartArea = 2

Public Const xlChartAsWindow = 5

Public Const xlChartInPlace = 4

Public Const xlChartSeries = 17

Public Const xlChartShort = 6

Public Const xlChartTitle = 4

Public Const xlChartTitles = 18

Public Const xlCheckBox = 1

Public Const xlChecker = 9

Public Const xlChronological = 3

Public Const xlCircle = 8

Public Const xlClassic1 = 1

Public Const xlClassic2 = 2

Public Const xlClassic3 = 3

Public Const xlClipboard = 3

Public Const xlClipboardFormatBIFF = 8

Public Const xlClipboardFormatBIFF2 = 18

Public Const xlClipboardFormatBIFF3 = 20

Public Const xlClipboardFormatBIFF4 = 30

Public Const xlClipboardFormatBinary = 15

Public Const xlClipboardFormatBitmap = 9

Public Const xlClipboardFormatCGM = 13

Public Const xlClipboardFormatCSV = 5

Public Const xlClipboardFormatDIF = 4

Public Const xlClipboardFormatDspText = 12

Public Const xlClipboardFormatEmbeddedObject = 21

Public Const xlClipboardFormatEmbedSource = 22

Public Const xlClipboardFormatLink = 11

Public Const xlClipboardFormatLinkSource = 23

Public Const xlClipboardFormatLinkSourceDesc = 32

Public Const xlClipboardFormatMovie = 24

Public Const xlClipboardFormatNative = 14

Public Const xlClipboardFormatObjectDesc = 31

Public Const xlClipboardFormatObjectLink = 19

Public Const xlClipboardFormatOwnerLink = 17

Public Const xlClipboardFormatPICT = 2

Public Const xlClipboardFormatPrintPICT = 3

Public Const xlClipboardFormatRTF = 7

Public Const xlClipboardFormatScreenPICT = 29

Public Const xlClipboardFormatStandardFont = 28

Public Const xlClipboardFormatStandardScale = 27

Public Const xlClipboardFormatSYLK = 6

Public Const xlClipboardFormatTable = 16

Public Const xlClipboardFormatText = 0

Public Const xlClipboardFormatToolFace = 25

Public Const xlClipboardFormatToolFacePICT = 26

Public Const xlClipboardFormatVALU = 1

Public Const xlClipboardFormatWK1 = 10

Public Const xlClosed = 3

Public Const xlCodePage = 2

Public Const xlColor1 = 7

Public Const xlColor2 = 8

Public Const xlColor3 = 9

Public Const xlColorIndexAutomatic = -4105

Public Const xlColorIndexNone = -4142

Public Const xlColumn = 3

Public Const xlColumnClustered = 51

Public Const xlColumnField = 2

Public Const xlColumnHeader = -4110

Public Const xlColumnItem = 5

Public Const xlColumnLabels = 2

Public Const xlColumns = 2

Public Const xlColumnSeparator = 14

Public Const xlColumnStacked = 52

Public Const xlColumnStacked100 = 53

Public Const xlColumnThenRow = 2

Public Const xlCombination = -4111

Public Const xlCommand = 2

Public Const xlCommandUnderlinesAutomatic = -4105

Public Const xlCommandUnderlinesOff = -4146

Public Const xlCommandUnderlinesOn = 1

Public Const xlCommentAndIndicator = 1

Public Const xlCommentIndicatorOnly = -1

Public Const xlComments = -4144

Public Const xlComplete = 4

Public Const xlConeBarClustered = 102

Public Const xlConeBarStacked = 103

Public Const xlConeBarStacked100 = 104

Public Const xlConeCol = 105

Public Const xlConeColClustered = 99

Public Const xlConeColStacked = 100

Public Const xlConeColStacked100 = 101

Public Const xlConeToMax = 5

Public Const xlConeToPoint = 4

Public Const xlConsolidation = 3

Public Const xlConstant = 1

Public Const xlConstants = 2

Public Const xlContents = 2

Public Const xlContext = -5002

Public Const xlContinuous = 1

Public Const xlCopy = 1

Public Const xlCorner = 2

Public Const xlCorners = 6

Public Const xlCount = -4112

Public Const xlCountNums = -4113

Public Const xlCountryCode = 1

Public Const xlCountrySetting = 2

Public Const xlCreatorCode = 1480803660

Public Const xlCrissCross = 16

Public Const xlCross = 4

Public Const xlCSV = 6

Public Const xlCSVMac = 22

Public Const xlCSVMSDOS = 24

Public Const xlCSVWindows = 23

Public Const xlCurrencyBefore = 37

Public Const xlCurrencyCode = 25

Public Const xlCurrencyDigits = 27

Public Const xlCurrencyLeadingZeros = 40

Public Const xlCurrencyMinusSign = 38

Public Const xlCurrencyNegative = 28

Public Const xlCurrencySpaceBefore = 36

Public Const xlCurrencyTrailingZeros = 39

Public Const xlCurrentPlatformText = -4158

Public Const xlCustom = -4114

Public Const xlCut = 2

Public Const xlCylinder = 3

Public Const xlCylinderBarClustered = 95

Public Const xlCylinderBarStacked = 96

Public Const xlCylinderBarStacked100 = 97

Public Const xlCylinderCol = 98

Public Const xlCylinderColClustered = 92

Public Const xlCylinderColStacked = 93

Public Const xlCylinderColStacked100 = 94

Public Const xlDash = -4115

Public Const xlDashDot = 4

Public Const xlDashDotDot = 5

Public Const xlDataAndLabel = 0

Public Const xlDatabase = 1

Public Const xlDataField = 4

Public Const xlDataHeader = 3

Public Const xlDataItem = 7

Public Const xlDataLabel = 0

Public Const xlDataLabelsShowBubbleSizes = 6

Public Const xlDataLabelsShowLabel = 4

Public Const xlDataLabelsShowLabelAndPercent = 5

Public Const xlDataLabelsShowNone = -4142

Public Const xlDataLabelsShowPercent = 3

Public Const xlDataLabelsShowValue = 2

Public Const xlDataOnly = 2

Public Const xlDataSeriesLinear = -4132

Public Const xlDataTable = 7

Public Const xlDate = 2

Public Const xlDateOrder = 32

Public Const xlDateSeparator = 17

Public Const xlDay = 1

Public Const xlDayCode = 21

Public Const xlDayLeadingZero = 42

Public Const xlDays = 0

Public Const xlDBF2 = 7

Public Const xlDBF3 = 8

Public Const xlDBF4 = 11

Public Const xlDebugCodePane = 13

Public Const xlDecimalSeparator = 3

Public Const xlDefault = -4143

Public Const xlDefaultAutoFormat = -1

Public Const xlDelimited = 1

Public Const xlDescending = 2

Public Const xlDesktop = 9

Public Const xlDiagonalDown = 5

Public Const xlDiagonalUp = 6

Public Const xlDialogActivate = 103

Public Const xlDialogActiveCellFont = 476

Public Const xlDialogAddChartAutoformat = 390

Public Const xlDialogAddinManager = 321

Public Const xlDialogAlignment = 43

Public Const xlDialogApplyNames = 133

Public Const xlDialogApplyStyle = 212

Public Const xlDialogAppMove = 170

Public Const xlDialogAppSize = 171

Public Const xlDialogArrangeAll = 12

Public Const xlDialogAssignToObject = 213

Public Const xlDialogAssignToTool = 293

Public Const xlDialogAttachText = 80

Public Const xlDialogAttachToolbars = 323

Public Const xlDialogAutoCorrect = 485

Public Const xlDialogAxes = 78

Public Const xlDialogBorder = 45

Public Const xlDialogCalculation = 32

Public Const xlDialogCellProtection = 46

Public Const xlDialogChangeLink = 166

Public Const xlDialogChartAddData = 392

Public Const xlDialogChartLocation = 527

Public Const xlDialogChartOptionsDataLabels = 505

Public Const xlDialogChartOptionsDataTable = 506

Public Const xlDialogChartSourceData = 541

Public Const xlDialogChartTrend = 350

Public Const xlDialogChartType = 526

Public Const xlDialogChartWizard = 288

Public Const xlDialogCheckboxProperties = 435

Public Const xlDialogClear = 52

Public Const xlDialogColorPalette = 161

Public Const xlDialogColumnWidth = 47

Public Const xlDialogCombination = 73

Public Const xlDialogConditionalFormatting = 583

Public Const xlDialogConsolidate = 191

Public Const xlDialogCopyChart = 147

Public Const xlDialogCopyPicture = 108

Public Const xlDialogCreateNames = 62

Public Const xlDialogCreatePublisher = 217

Public Const xlDialogCustomizeToolbar = 276

Public Const xlDialogCustomViews = 493

Public Const xlDialogDataDelete = 36

Public Const xlDialogDataLabel = 379

Public Const xlDialogDataSeries = 40

Public Const xlDialogDataValidation = 525

Public Const xlDialogDefineName = 61

Public Const xlDialogDefineStyle = 229

Public Const xlDialogDeleteFormat = 111

Public Const xlDialogDeleteName = 110

Public Const xlDialogDemote = 203

Public Const xlDialogDisplay = 27

Public Const xlDialogEditboxProperties = 438

Public Const xlDialogEditColor = 223

Public Const xlDialogEditDelete = 54

Public Const xlDialogEditionOptions = 251

Public Const xlDialogEditSeries = 228

Public Const xlDialogErrorbarX = 463

Public Const xlDialogErrorbarY = 464

Public Const xlDialogExtract = 35

Public Const xlDialogFileDelete = 6

Public Const xlDialogFileSharing = 481

Public Const xlDialogFillGroup = 200

Public Const xlDialogFillWorkgroup = 301

Public Const xlDialogFilter = 447

Public Const xlDialogFilterAdvanced = 370

Public Const xlDialogFindFile = 475

Public Const xlDialogFont = 26

Public Const xlDialogFontProperties = 381

Public Const xlDialogFormatAuto = 269

Public Const xlDialogFormatChart = 465

Public Const xlDialogFormatCharttype = 423

Public Const xlDialogFormatFont = 150

Public Const xlDialogFormatLegend = 88

Public Const xlDialogFormatMain = 225

Public Const xlDialogFormatMove = 128

Public Const xlDialogFormatNumber = 42

Public Const xlDialogFormatOverlay = 226

Public Const xlDialogFormatSize = 129

Public Const xlDialogFormatText = 89

Public Const xlDialogFormulaFind = 64

Public Const xlDialogFormulaGoto = 63

Public Const xlDialogFormulaReplace = 130

Public Const xlDialogFunctionWizard = 450

Public Const xlDialogGallery3dArea = 193

Public Const xlDialogGallery3dBar = 272

Public Const xlDialogGallery3dColumn = 194

Public Const xlDialogGallery3dLine = 195

Public Const xlDialogGallery3dPie = 196

Public Const xlDialogGallery3dSurface = 273

Public Const xlDialogGalleryArea = 67

Public Const xlDialogGalleryBar = 68

Public Const xlDialogGalleryColumn = 69

Public Const xlDialogGalleryCustom = 388

Public Const xlDialogGalleryDoughnut = 344

Public Const xlDialogGalleryLine = 70

Public Const xlDialogGalleryPie = 71

Public Const xlDialogGalleryRadar = 249

Public Const xlDialogGalleryScatter = 72

Public Const xlDialogGoalSeek = 198

Public Const xlDialogGridlines = 76

Public Const xlDialogInsert = 55

Public Const xlDialogInsertHyperlink = 596

Public Const xlDialogInsertNameLabel = 496

Public Const xlDialogInsertObject = 259

Public Const xlDialogInsertPicture = 342

Public Const xlDialogInsertTitle = 380

Public Const xlDialogLabelProperties = 436

Public Const xlDialogListboxProperties = 437

Public Const xlDialogMacroOptions = 382

Public Const xlDialogMailEditMailer = 470

Public Const xlDialogMailLogon = 339

Public Const xlDialogMailNextLetter = 378

Public Const xlDialogMainChart = 85

Public Const xlDialogMainChartType = 185

Public Const xlDialogMenuEditor = 322

Public Const xlDialogMove = 262

Public Const xlDialogNew = 119

Public Const xlDialogNote = 154

Public Const xlDialogObjectProperties = 207

Public Const xlDialogObjectProtection = 214

Public Const xlDialogOpen = 1

Public Const xlDialogOpenLinks = 2

Public Const xlDialogOpenMail = 188

Public Const xlDialogOpenText = 441

Public Const xlDialogOptionsCalculation = 318

Public Const xlDialogOptionsChart = 325

Public Const xlDialogOptionsEdit = 319

Public Const xlDialogOptionsGeneral = 356

Public Const xlDialogOptionsListsAdd = 458

Public Const xlDialogOptionsTransition = 355

Public Const xlDialogOptionsView = 320

Public Const xlDialogOutline = 142

Public Const xlDialogOverlay = 86

Public Const xlDialogOverlayChartType = 186

Public Const xlDialogPageSetup = 7

Public Const xlDialogParse = 91

Public Const xlDialogPasteNames = 58

Public Const xlDialogPasteSpecial = 53

Public Const xlDialogPatterns = 84

Public Const xlDialogPhonetic = 538

Public Const xlDialogPivotCalculatedField = 570

Public Const xlDialogPivotCalculatedItem = 572

Public Const xlDialogPivotFieldGroup = 433

Public Const xlDialogPivotFieldProperties = 313

Public Const xlDialogPivotFieldUngroup = 434

Public Const xlDialogPivotShowPages = 421

Public Const xlDialogPivotSolveOrder = 568

Public Const xlDialogPivotTableOptions = 567

Public Const xlDialogPivotTableWizard = 312

Public Const xlDialogPlacement = 300

Public Const xlDialogPrint = 8

Public Const xlDialogPrinterSetup = 9

Public Const xlDialogPrintPreview = 222

Public Const xlDialogPromote = 202

Public Const xlDialogProperties = 474

Public Const xlDialogProtectDocument = 28

Public Const xlDialogProtectSharing = 620

Public Const xlDialogPushbuttonProperties = 445

Public Const xlDialogReplaceFont = 134

Public Const xlDialogRoutingSlip = 336

Public Const xlDialogRowHeight = 127

Public Const xlDialogRun = 17

Public Const xlDialogSaveAs = 5

Public Const xlDialogSaveCopyAs = 456

Public Const xlDialogSaveNewObject = 208

Public Const xlDialogSaveWorkbook = 145

Public Const xlDialogSaveWorkspace = 285

Public Const xlDialogScale = 87

Public Const xlDialogScenarioAdd = 307

Public Const xlDialogScenarioCells = 305

Public Const xlDialogScenarioEdit = 308

Public Const xlDialogScenarioMerge = 473

Public Const xlDialogScenarioSummary = 311

Public Const xlDialogScrollbarProperties = 420

Public Const xlDialogSelectSpecial = 132

Public Const xlDialogSendMail = 189

Public Const xlDialogSeriesAxes = 460

Public Const xlDialogSeriesOptions = 557

Public Const xlDialogSeriesOrder = 466

Public Const xlDialogSeriesShape = 504

Public Const xlDialogSeriesX = 461

Public Const xlDialogSeriesY = 462

Public Const xlDialogSetBackgroundPicture = 509

Public Const xlDialogSetPrintTitles = 23

Public Const xlDialogSetUpdateStatus = 159

Public Const xlDialogSheet = -4116

Public Const xlDialogShowDetail = 204

Public Const xlDialogShowToolbar = 220

Public Const xlDialogSize = 261

Public Const xlDialogSort = 39

Public Const xlDialogSortSpecial = 192

Public Const xlDialogSplit = 137

Public Const xlDialogStandardFont = 190

Public Const xlDialogStandardWidth = 472

Public Const xlDialogStyle = 44

Public Const xlDialogSubscribeTo = 218

Public Const xlDialogSubtotalCreate = 398

Public Const xlDialogSummaryInfo = 474

Public Const xlDialogTable = 41

Public Const xlDialogTabOrder = 394

Public Const xlDialogTextToColumns = 422

Public Const xlDialogUnhide = 94

Public Const xlDialogUpdateLink = 201

Public Const xlDialogVbaInsertFile = 328

Public Const xlDialogVbaMakeAddin = 478

Public Const xlDialogVbaProcedureDefinition = 330

Public Const xlDialogView3d = 197

Public Const xlDialogWindowMove = 14

Public Const xlDialogWindowSize = 13

Public Const xlDialogWorkbookAdd = 281

Public Const xlDialogWorkbookCopy = 283

Public Const xlDialogWorkbookInsert = 354

Public Const xlDialogWorkbookMove = 282

Public Const xlDialogWorkbookName = 386

Public Const xlDialogWorkbookNew = 302

Public Const xlDialogWorkbookOptions = 284

Public Const xlDialogWorkbookProtect = 417

Public Const xlDialogWorkbookTabSplit = 415

Public Const xlDialogWorkbookUnhide = 384

Public Const xlDialogWorkgroup = 199

Public Const xlDialogWorkspace = 95

Public Const xlDialogZoom = 256

Public Const xlDiamond = 2

Public Const xlDIF = 9

Public Const xlDifferenceFrom = 2

Public Const xlDirect = 1

Public Const xlDisabled = 0

Public Const XlDisplayShapes = -4104

Public Const xlDistributed = -4117

Public Const xlDivide = 5

Public Const xlDoNotSaveChanges = 2

Public Const xlDot = -4118

Public Const xlDouble = -4119

Public Const xlDoubleAccounting = 5

Public Const xlDoubleClosed = 5

Public Const xlDoubleOpen = 4

Public Const xlDoubleQuote = 1

Public Const xlDoughnut = -4120

Public Const xlDoughnutExploded = 80

Public Const xlDown = -4121

Public Const xlDownBars = 20

Public Const xlDownThenOver = 1

Public Const xlDownward = -4170

Public Const xlDrawingObject = 14

Public Const xlDropDown = 2

Public Const xlDropLines = 26

Public Const xlDRW = 4

Public Const xlDXF = 5

Public Const xlEdgeBottom = 9

Public Const xlEdgeLeft = 7

Public Const xlEdgeRight = 10

Public Const xlEdgeTop = 8

Public Const xlEditBox = 3

Public Const xlEditionDate = 2

Public Const xlEnd = 2

Public Const xlEndSides = 3

Public Const xlEntireChart = 20

Public Const xlEPS = 8

Public Const xlEqual = 3

Public Const xlErrDiv0 = 2007

Public Const xlErrNA = 2042

Public Const xlErrName = 2029

Public Const xlErrNull = 2000

Public Const xlErrNum = 2036

Public Const xlErrorBarIncludeBoth = 1

Public Const xlErrorBarIncludeMinusValues = 3

Public Const xlErrorBarIncludeNone = -4142

Public Const xlErrorBarIncludePlusValues = 2

Public Const xlErrorBars = 9

Public Const xlErrorBarTypeCustom = -4114

Public Const xlErrorBarTypeFixedValue = 1

Public Const xlErrorBarTypePercent = 2

Public Const xlErrorBarTypeStDev = -4155

Public Const xlErrorBarTypeStError = 4

Public Const xlErrorHandler = 2

Public Const xlErrors = 16

Public Const xlErrRef = 2023

Public Const xlErrValue = 2015

Public Const xlExcel2 = 16

Public Const xlExcel2FarEast = 27

Public Const xlExcel3 = 29

Public Const xlExcel4 = 33

Public Const xlExcel4IntlMacroSheet = 4

Public Const xlExcel4MacroSheet = 3

Public Const xlExcel4Workbook = 35

Public Const xlExcel5 = 39

Public Const xlExcel7 = 39

Public Const xlExcel9795 = 43

Public Const xlExcelLinks = 1

Public Const xlExcelMenus = 1

Public Const xlExclusive = 3

Public Const xlExponential = 5

Public Const xlExpression = 2

Public Const xlExtended = 3

Public Const xlExternal = 2

Public Const xlFill = 5

Public Const xlFillCopy = 1

Public Const xlFillDays = 5

Public Const xlFillDefault = 0

Public Const xlFillFormats = 3

Public Const xlFillMonths = 7

Public Const xlFillSeries = 2

Public Const xlFillValues = 4

Public Const xlFillWeekdays = 6

Public Const xlFillWithAll = -4104

Public Const xlFillWithContents = 2

Public Const xlFillWithFormats = -4122

Public Const xlFillYears = 8

Public Const xlFilterCopy = 2

Public Const xlFilterInPlace = 1

Public Const xlFirst = 0

Public Const xlFitToPage = 2

Public Const xlFixedValue = 1

Public Const xlFixedWidth = 2

Public Const xlFloating = 5

Public Const xlFloor = 23

Public Const xlFormats = -4122

Public Const xlFormula = 5

Public Const xlFormulas = -4123

Public Const xlFreeFloating = 3

Public Const xlFront = 4

Public Const xlFrontEnd = 6

Public Const xlFrontSides = 5

Public Const xlFullPage = 3

Public Const xlFunction = 1

Public Const xlGeneral = 1

Public Const xlGeneralFormatName = 26

Public Const xlGray16 = 17

Public Const xlGray25 = -4124

Public Const xlGray50 = -4125

Public Const xlGray75 = -4126

Public Const xlGray8 = 18

Public Const xlGreater = 5

Public Const xlGreaterEqual = 7

Public Const xlGregorian = 2

Public Const xlGrid = 15

Public Const xlGridline = 22

Public Const xlGroupBox = 4

Public Const xlGrowth = 2

Public Const xlGrowthTrend = 10

Public Const xlGuess = 0

Public Const xlHairline = 1

Public Const xlHAlignCenter = -4108

Public Const xlHAlignCenterAcrossSelection = 7

Public Const xlHAlignDistributed = -4117

Public Const xlHAlignFill = 5

Public Const xlHAlignGeneral = 1

Public Const xlHAlignJustify = -4130

Public Const xlHAlignLeft = -4131

Public Const xlHAlignRight = -4152

Public Const xlHGL = 6

Public Const xlHidden = 0

Public Const xlHide = 3

Public Const xlHigh = -4127

Public Const xlHiLoLines = 25

Public Const xlHindiNumerals = 3

Public Const xlHiragana = 2

Public Const xlHorizontal = -4128

Public Const xlHourCode = 22

Public Const xlIBeam = 3

Public Const xlIcons = 1

Public Const xlIMEModeAlpha = 8

Public Const xlIMEModeAlphaFull = 7

Public Const xlIMEModeDisable = 3

Public Const xlIMEModeHangul = 10

Public Const xlIMEModeHangulFull = 9

Public Const xlIMEModeHiragana = 4

Public Const xlIMEModeKatakana = 5

Public Const xlIMEModeKatakanaHalf = 6

Public Const xlIMEModeNoControl = 0

Public Const xlIMEModeOff = 2

Public Const xlIMEModeOn = 1

Public Const xlImmediatePane = 12

Public Const xlIndex = 9

Public Const xlInfo = -4129

Public Const xlInsertDeleteCells = 1

Public Const xlInsertEntireRows = 2

Public Const xlInside = 2

Public Const xlInsideHorizontal = 12

Public Const xlInsideVertical = 11

Public Const xlInteger = 2

Public Const xlInterpolated = 3

Public Const xlInterrupt = 1

Public Const xlIntlAddIn = 26

Public Const xlIntlMacro = 25

Public Const xlJustify = -4130

Public Const xlKatakana = 1

Public Const xlKatakanaHalf = 0

Public Const xlLabel = 5

Public Const xlLabelOnly = 1

Public Const xlLabelPositionAbove = 0

Public Const xlLabelPositionBelow = 1

Public Const xlLabelPositionBestFit = 5

Public Const xlLabelPositionCenter = -4108

Public Const xlLabelPositionCustom = 7

Public Const xlLabelPositionInsideBase = 4

Public Const xlLabelPositionInsideEnd = 3

Public Const xlLabelPositionLeft = -4131

Public Const xlLabelPositionMixed = 6

Public Const xlLabelPositionOutsideEnd = 2

Public Const xlLabelPositionRight = -4152

Public Const xlLandscape = 2

Public Const xlLast = 1

Public Const xlLastCell = 11

Public Const xlLatin = -5001

Public Const xlLeaderLines = 29

Public Const xlLeft = -4131

Public Const xlLeftBrace = 12

Public Const xlLeftBracket = 10

Public Const xlLeftToRight = 2

Public Const xlLegend = 24

Public Const xlLegendEntry = 12

Public Const xlLegendKey = 13

Public Const xlLegendPositionBottom = -4107

Public Const xlLegendPositionCorner = 2

Public Const xlLegendPositionLeft = -4131

Public Const xlLegendPositionRight = -4152

Public Const xlLegendPositionTop = -4160

Public Const xlLess = 6

Public Const xlLessEqual = 8

Public Const xlLightDown = 13

Public Const xlLightHorizontal = 11

Public Const xlLightUp = 14

Public Const xlLightVertical = 12

Public Const xlLine = 4

Public Const xlLinear = -4132

Public Const xlLinearTrend = 9

Public Const xlLineMarkers = 65

Public Const xlLineMarkersStacked = 66

Public Const xlLineMarkersStacked100 = 67

Public Const xlLineStacked = 63

Public Const xlLineStacked100 = 64

Public Const xlLineStyleNone = -4142

Public Const xlLinkInfoOLELinks = 2

Public Const xlLinkInfoPublishers = 5

Public Const xlLinkInfoSubscribers = 6

Public Const xlLinkTypeExcelLinks = 1

Public Const xlLinkTypeOLELinks = 2

Public Const xlList1 = 10

Public Const xlList2 = 11

Public Const xlList3 = 12

Public Const xlListBox = 6

Public Const xlListSeparator = 5

Public Const xlLocalFormat1 = 15

Public Const xlLocalFormat2 = 16

Public Const xlLocalSessionChanges = 2

Public Const xlLocationAsNewSheet = 1

Public Const xlLocationAsObject = 2

Public Const xlLocationAutomatic = 3

Public Const xlLogarithmic = -4133

Public Const xlLogical = 4

Public Const xlLogicalCursor = 1

Public Const xlLong = 3

Public Const xlLotusHelp = 2

Public Const xlLow = -4134

Public Const xlLowerCaseColumnLetter = 9

Public Const xlLowerCaseRowLetter = 8

Public Const xlLTR = -5003

Public Const xlMacintosh = 1

Public Const xlMacrosheetCell = 7

Public Const xlMajorGridlines = 15

Public Const xlManual = -4135

Public Const xlManualUpdate = 5

Public Const xlMAPI = 1

Public Const xlMarkerStyleAutomatic = -4105

Public Const xlMarkerStyleCircle = 8

Public Const xlMarkerStyleDash = -4115

Public Const xlMarkerStyleDiamond = 2

Public Const xlMarkerStyleDot = -4118

Public Const xlMarkerStyleNone = -4142

Public Const xlMarkerStylePicture = -4147

Public Const xlMarkerStylePlus = 9

Public Const xlMarkerStyleSquare = 1

Public Const xlMarkerStyleStar = 5

Public Const xlMarkerStyleTriangle = 3

Public Const xlMarkerStyleX = -4168

Public Const xlMax = -4136

Public Const xlMaximized = -4137

Public Const xlMaximum = 2

Public Const xlMDY = 44

Public Const xlMedium = -4138

Public Const xlMetric = 35

Public Const xlMicrosoftAccess = 4

Public Const xlMicrosoftFoxPro = 5

Public Const xlMicrosoftMail = 3

Public Const xlMicrosoftPowerPoint = 2

Public Const xlMicrosoftProject = 6

Public Const xlMicrosoftSchedulePlus = 7

Public Const xlMicrosoftWord = 1

Public Const xlMin = -4139

Public Const xlMinimized = -4140

Public Const xlMinimum = 4

Public Const xlMinorGridlines = 16

Public Const xlMinusValues = 3

Public Const xlMinuteCode = 23

Public Const xlMixed = 2

Public Const xlMixedLabels = 3

Public Const xlModule = -4141

Public Const xlMonth = 3

Public Const xlMonthCode = 20

Public Const xlMonthLeadingZero = 41

Public Const xlMonthNameChars = 30

Public Const xlMonths = 1

Public Const xlMove = 2

Public Const xlMoveAndSize = 1

Public Const xlMovingAvg = 6

Public Const xlMSDOS = 3

Public Const xlMultiply = 4

Public Const xlNarrow = 1

Public Const xlNext = 1

Public Const xlNextToAxis = 4

Public Const xlNo = 2

Public Const xlNoAdditionalCalculation = -4143

Public Const xlNoButton = 0

Public Const xlNoButtonChanges = 1

Public Const xlNoCap = 2

Public Const xlNoChange = 1

Public Const xlNoChanges = 4

Public Const xlNoConversion = 3

Public Const xlNoDockingChanges = 3

Public Const xlNoDocuments = 3

Public Const xlNoIndicator = 0

Public Const xlNoLabels = -4142

Public Const xlNoMailSystem = 0

Public Const xlNoncurrencyDigits = 29

Public Const xlNone = -4142

Public Const xlNonEnglishFunctions = 34

Public Const xlNoRestrictions = 0

Public Const xlNormal = -4143

Public Const xlNormalView = 1

Public Const xlNorthwestArrow = 1

Public Const xlNoSelection = -4142

Public Const xlNoShapeChanges = 2

Public Const xlNotBetween = 2

Public Const xlNotEqual = 4

Public Const xlNotes = -4144

Public Const xlNothing = 28

Public Const xlNotPlotted = 1

Public Const xlNotXLM = 3

Public Const xlNotYetReviewed = 3

Public Const xlNotYetRouted = 0

Public Const xlNumber = -4145

Public Const xlNumbers = 1

Public Const xlOff = -4146

Public Const xlOLEControl = 2

Public Const xlOLEEmbed = 1

Public Const xlOLELink = 0

Public Const xlOLELinks = 2

Public Const xlOn = 1

Public Const xlOneAfterAnother = 1

Public Const xlOpaque = 3

Public Const xlOpen = 2

Public Const xlOpenSource = 3

Public Const xlOptionButton = 7

Public Const xlOr = 2

Public Const xlOrigin = 3

Public Const xlOtherSessionChanges = 3

Public Const xlOutside = 3

Public Const xlOverThenDown = 2

Public Const xlOverwriteCells = 0

Public Const xlPageBreakAutomatic = -4105

Public Const xlPageBreakFull = 1

Public Const xlPageBreakManual = -4135

Public Const xlPageBreakPartial = 2

Public Const xlPageBreakPreview = 2

Public Const xlPageField = 3

Public Const xlPageHeader = 2

Public Const xlPageItem = 6

Public Const xlPaper10x14 = 16

Public Const xlPaper11x17 = 17

Public Const xlPaperA3 = 8

Public Const xlPaperA4 = 9

Public Const xlPaperA4Small = 10

Public Const xlPaperA5 = 11

Public Const xlPaperB4 = 12

Public Const xlPaperB5 = 13

Public Const xlPaperCsheet = 24

Public Const xlPaperDsheet = 25

Public Const xlPaperEnvelope10 = 20

Public Const xlPaperEnvelope11 = 21

Public Const xlPaperEnvelope12 = 22

Public Const xlPaperEnvelope14 = 23

Public Const xlPaperEnvelope9 = 19

Public Const xlPaperEnvelopeB4 = 33

Public Const xlPaperEnvelopeB5 = 34

Public Const xlPaperEnvelopeB6 = 35

Public Const xlPaperEnvelopeC3 = 29

Public Const xlPaperEnvelopeC4 = 30

Public Const xlPaperEnvelopeC5 = 28

Public Const xlPaperEnvelopeC6 = 31

Public Const xlPaperEnvelopeC65 = 32

Public Const xlPaperEnvelopeDL = 27

Public Const xlPaperEnvelopeItaly = 36

Public Const xlPaperEnvelopeMonarch = 37

Public Const xlPaperEnvelopePersonal = 38

Public Const xlPaperEsheet = 26

Public Const xlPaperExecutive = 7

Public Const xlPaperFanfoldLegalGerman = 41

Public Const xlPaperFanfoldStdGerman = 40

Public Const xlPaperFanfoldUS = 39

Public Const xlPaperFolio = 14

Public Const xlPaperLedger = 4

Public Const xlPaperLegal = 5

Public Const xlPaperLetter = 1

Public Const xlPaperLetterSmall = 2

Public Const xlPaperNote = 18

Public Const xlPaperQuarto = 15

Public Const xlPaperStatement = 6

Public Const xlPaperTabloid = 3

Public Const xlPaperUser = 256

Public Const xlParamTypeBigInt = -5

Public Const xlParamTypeBinary = -2

Public Const xlParamTypeBit = -7

Public Const xlParamTypeChar = 1

Public Const xlParamTypeDate = 9

Public Const xlParamTypeDecimal = 3

Public Const xlParamTypeDouble = 8

Public Const xlParamTypeFloat = 6

Public Const xlParamTypeInteger = 4

Public Const xlParamTypeLongVarBinary = -4

Public Const xlParamTypeLongVarChar = -1

Public Const xlParamTypeNumeric = 2

Public Const xlParamTypeReal = 7

Public Const xlParamTypeSmallInt = 5

Public Const xlParamTypeTime = 10

Public Const xlParamTypeTimestamp = 11

Public Const xlParamTypeTinyInt = -6

Public Const xlParamTypeUnknown = 0

Public Const xlParamTypeVarBinary = -3

Public Const xlParamTypeVarChar = 12

Public Const xlPart = 2

Public Const xlPartial = 3

Public Const xlPasteAll = -4104

Public Const xlPasteAllExceptBorders = 6

Public Const xlPasteComments = -4144

Public Const xlPasteFormats = -4122

Public Const xlPasteFormulas = -4123

Public Const xlPasteSpecialOperationAdd = 2

Public Const xlPasteSpecialOperationDivide = 5

Public Const xlPasteSpecialOperationMultiply = 4

Public Const xlPasteSpecialOperationNone = -4142

Public Const xlPasteSpecialOperationSubtract = 3

Public Const xlPasteValues = -4163

Public Const xlPatternAutomatic = -4105

Public Const xlPatternChecker = 9

Public Const xlPatternCrissCross = 16

Public Const xlPatternDown = -4121

Public Const xlPatternGray16 = 17

Public Const xlPatternGray25 = -4124

Public Const xlPatternGray50 = -4125

Public Const xlPatternGray75 = -4126

Public Const xlPatternGray8 = 18

Public Const xlPatternGrid = 15

Public Const xlPatternHorizontal = -4128

Public Const xlPatternLightDown = 13

Public Const xlPatternLightHorizontal = 11

Public Const xlPatternLightUp = 14

Public Const xlPatternLightVertical = 12

Public Const xlPatternNone = -4142

Public Const xlPatternSemiGray75 = 10

Public Const xlPatternSolid = 1

Public Const xlPatternUp = -4162

Public Const xlPatternVertical = -4166

Public Const xlPCT = 13

Public Const xlPCX = 10

Public Const xlPercent = 2

Public Const xlPercentDifferenceFrom = 4

Public Const xlPercentOf = 3

Public Const xlPercentOfColumn = 7

Public Const xlPercentOfRow = 6

Public Const xlPercentOfTotal = 8

Public Const xlPhoneticAlignCenter = 2

Public Const xlPhoneticAlignDistributed = 3

Public Const xlPhoneticAlignLeft = 1

Public Const xlPhoneticAlignNoControl = 0

Public Const xlPIC = 11

Public Const xlPICT = 1

Public Const xlPicture = -4147

Public Const xlPie = 5

Public Const xlPieExploded = 69

Public Const xlPieOfPie = 68

Public Const xlPinYin = 1

Public Const xlPivotTable = -4148

Public Const xlPlaceholders = 2

Public Const xlPlotArea = 19

Public Const xlPLT = 12

Public Const xlPlus = 9

Public Const xlPlusValues = 2

Public Const xlPolynomial = 3

Public Const xlPortrait = 1

Public Const xlPower = 4

Public Const xlPowerTalk = 2

Public Const xlPrevious = 2

Public Const xlPrimary = 1

Public Const xlPrimaryButton = 1

Public Const xlPrinter = 2

Public Const xlPrintInPlace = 16

Public Const xlPrintNoComments = -4142

Public Const xlPrintSheetEnd = 1

Public Const xlPriorityHigh = -4127

Public Const xlPriorityLow = -4134

Public Const xlPriorityNormal = -4143

Public Const xlProduct = -4149

Public Const xlPrompt = 0

Public Const xlPublisher = 1

Public Const xlPublishers = 5

Public Const xlPyramidBarClustered = 109

Public Const xlPyramidBarStacked = 110

Public Const xlPyramidBarStacked100 = 111

Public Const xlPyramidCol = 112

Public Const xlPyramidColClustered = 106

Public Const xlPyramidColStacked = 107

Public Const xlPyramidColStacked100 = 108

Public Const xlPyramidToMax = 2

Public Const xlPyramidToPoint = 1

Public Const xlR1C1 = -4150

Public Const xlRadar = -4151

Public Const xlRadarAxisLabels = 27

Public Const xlRadarFilled = 82

Public Const xlRadarMarkers = 81

Public Const xlRange = 2

Public Const xlRangeAutoFormat3DEffects1 = 13

Public Const xlRangeAutoFormat3DEffects2 = 14

Public Const xlRangeAutoFormatAccounting1 = 4

Public Const xlRangeAutoFormatAccounting2 = 5

Public Const xlRangeAutoFormatAccounting3 = 6

Public Const xlRangeAutoFormatAccounting4 = 17

Public Const xlRangeAutoFormatClassic1 = 1

Public Const xlRangeAutoFormatClassic2 = 2

Public Const xlRangeAutoFormatClassic3 = 3

Public Const xlRangeAutoFormatColor1 = 7

Public Const xlRangeAutoFormatColor2 = 8

Public Const xlRangeAutoFormatColor3 = 9

Public Const xlRangeAutoFormatList1 = 10

Public Const xlRangeAutoFormatList2 = 11

Public Const xlRangeAutoFormatList3 = 12

Public Const xlRangeAutoFormatLocalFormat1 = 15

Public Const xlRangeAutoFormatLocalFormat2 = 16

Public Const xlRangeAutoFormatLocalFormat3 = 19

Public Const xlRangeAutoFormatLocalFormat4 = 20

Public Const xlRangeAutoFormatNone = -4142

Public Const xlRangeAutoFormatSimple = -4154

Public Const xlReadOnly = 3

Public Const xlReadWrite = 2

Public Const xlReference = 4

Public Const xlRelative = 4

Public Const xlRelRowAbsColumn = 3

Public Const xlRight = -4152

Public Const xlRightBrace = 13

Public Const xlRightBracket = 11

Public Const xlRoutingComplete = 2

Public Const xlRoutingInProgress = 1

Public Const xlRowField = 1

Public Const xlRowHeader = -4153

Public Const xlRowItem = 4

Public Const xlRowLabels = 1

Public Const xlRows = 1

Public Const xlRowSeparator = 15

Public Const xlRowThenColumn = 1

Public Const xlRTF = 4

Public Const xlRTL = -5004

Public Const xlRunningTotal = 5

Public Const xlSaveChanges = 1

Public Const xlScale = 3

Public Const xlScaleLinear = -4132

Public Const xlScaleLogarithmic = -4133

Public Const xlScreen = 1

Public Const xlScreenSize = 1

Public Const xlScrollBar = 8

Public Const xlSecondary = 2

Public Const xlSecondaryButton = 2

Public Const xlSecondCode = 24

Public Const xlSelect = 3

Public Const xlSemiautomatic = 2

Public Const xlSemiGray75 = 10

Public Const xlSendPublisher = 2

Public Const xlSeries = 3

Public Const xlSeriesAxis = 3

Public Const xlSeriesLines = 22

Public Const xlShape = 14

Public Const xlShared = 2

Public Const xlSheetHidden = 0

Public Const xlSheetVeryHidden = 2

Public Const xlSheetVisible = -1

Public Const xlShiftDown = -4121

Public Const xlShiftToLeft = -4159

Public Const xlShiftToRight = -4161

Public Const xlShiftUp = -4162

Public Const xlShort = 1

Public Const xlShowLabel = 4

Public Const xlShowLabelAndPercent = 5

Public Const xlShowPercent = 3

Public Const xlShowValue = 2

Public Const xlSides = 1

Public Const xlSimple = -4154

Public Const xlSinceMyLastSave = 1

Public Const xlSingle = 2

Public Const xlSingleAccounting = 4

Public Const xlSingleQuote = 2

Public Const xlSizeIsArea = 1

Public Const xlSizeIsWidth = 2

Public Const xlSlantDashDot = 13

Public Const xlSolid = 1

Public Const xlSortColumns = 1

Public Const xlSortLabels = 2

Public Const xlSortRows = 2

Public Const xlSortValues = 1

Public Const xlSpinner = 9

Public Const xlSplitByCustomSplit = 4

Public Const xlSplitByPercentValue = 3

Public Const xlSplitByPosition = 1

Public Const xlSplitByValue = 2

Public Const xlSquare = 1

Public Const xlStack = 2

Public Const xlStackScale = 3

Public Const xlStandardSummary = 1

Public Const xlStar = 5

Public Const xlStDev = -4155

Public Const xlStDevP = -4156

Public Const xlStError = 4

Public Const xlStockHLC = 88

Public Const xlStockOHLC = 89

Public Const xlStockVHLC = 90

Public Const xlStockVOHLC = 91

Public Const xlStretch = 1

Public Const xlStrict = 2

Public Const xlStroke = 2

Public Const xlSubscriber = 2

Public Const xlSubscribers = 6

Public Const xlSubscribeToPicture = -4147

Public Const xlSubscribeToText = -4158

Public Const xlSubtract = 3

Public Const xlSum = -4157

Public Const xlSummaryAbove = 0

Public Const xlSummaryBelow = 1

Public Const xlSummaryOnLeft = -4131

Public Const xlSummaryOnRight = -4152

Public Const xlSummaryPivotTable = -4148

Public Const xlSurface = 83

Public Const xlSurfaceTopView = 85

Public Const xlSurfaceTopViewWireframe = 86

Public Const xlSurfaceWireframe = 84

Public Const xlSYLK = 2

Public Const xlSyllabary = 1

Public Const xlSystem = 1

Public Const xlTableBody = 8

Public Const xlTabPositionFirst = 0

Public Const xlTabPositionLast = 1

Public Const xlTemplate = 17

Public Const xlText = -4158

Public Const xlTextBox = 16

Public Const xlTextMac = 19

Public Const xlTextMSDOS = 21

Public Const xlTextPrinter = 36

Public Const xlTextQualifierDoubleQuote = 1

Public Const xlTextQualifierNone = -4142

Public Const xlTextQualifierSingleQuote = 2

Public Const xlTextValues = 2

Public Const xlTextWindows = 20

Public Const xlThick = 4

Public Const xlThin = 2

Public Const xlThousandsSeparator = 4

Public Const xlTickLabelOrientationAutomatic = -4105

Public Const xlTickLabelOrientationDownward = -4170

Public Const xlTickLabelOrientationHorizontal = -4128

Public Const xlTickLabelOrientationUpward = -4171

Public Const xlTickLabelOrientationVertical = -4166

Public Const xlTickLabelPositionHigh = -4127

Public Const xlTickLabelPositionLow = -4134

Public Const xlTickLabelPositionNextToAxis = 4

Public Const xlTickLabelPositionNone = -4142

Public Const xlTickMarkCross = 4

Public Const xlTickMarkInside = 2

Public Const xlTickMarkNone = -4142

Public Const xlTickMarkOutside = 3

Public Const xlTIF = 9

Public Const xlTiled = 1

Public Const xlTimeLeadingZero = 45

Public Const xlTimeScale = 3

Public Const xlTimeSeparator = 18

Public Const xlTitleBar = 8

Public Const xlToLeft = -4159

Public Const xlToolbar = 1

Public Const xlToolbarButton = 2

Public Const xlToolbarProtectionNone = -4143

Public Const xlTop = -4160

Public Const xlTop10Items = 3

Public Const xlTop10Percent = 5

Public Const xlTopToBottom = 1

Public Const xlToRight = -4161

Public Const xlTransparent = 2

Public Const xlTrendline = 8

Public Const xlTriangle = 3

Public Const xlUnderlineStyleDouble = -4119

Public Const xlUnderlineStyleDoubleAccounting = 5

Public Const xlUnderlineStyleNone = -4142

Public Const xlUnderlineStyleSingle = 2

Public Const xlUnderlineStyleSingleAccounting = 4

Public Const xlUnlockedCells = 1

Public Const xlUp = -4162

Public Const xlUpBars = 18

Public Const xlUpdateState = 1

Public Const xlUpdateSubscriber = 2

Public Const xlUpperCaseColumnLetter = 7

Public Const xlUpperCaseRowLetter = 6

Public Const xlUpward = -4171

Public Const xlUserDefined = 22

Public Const xlUserResolution = 1

Public Const xlValidAlertInformation = 3

Public Const xlValidAlertStop = 1

Public Const xlValidAlertWarning = 2

Public Const xlValidateCustom = 7

Public Const xlValidateDate = 4

Public Const xlValidateDecimal = 2

Public Const xlValidateInputOnly = 0

Public Const xlValidateList = 3

Public Const xlValidateTextLength = 6

Public Const xlValidateTime = 5

Public Const xlValidateWholeNumber = 1

Public Const xlVAlignBottom = -4107

Public Const xlVAlignCenter = -4108

Public Const xlVAlignDistributed = -4117

Public Const xlVAlignJustify = -4130

Public Const xlVAlignTop = -4160

Public Const xlVALU = 8

Public Const xlValue = 2

Public Const xlValues = -4163

Public Const xlVar = -4164

Public Const xlVarP = -4165

Public Const xlVerbOpen = 2

Public Const xlVerbPrimary = 1

Public Const xlVertical = -4166

Public Const xlVeryHidden = 2

Public Const xlVisible = 12

Public Const xlVisualCursor = 2

Public Const xlWait = 2

Public Const xlWalls = 5

Public Const xlWatchPane = 11

Public Const xlWBATChart = -4109

Public Const xlWBATExcel4IntlMacroSheet = 4

Public Const xlWBATExcel4MacroSheet = 3

Public Const xlWBATWorksheet = -4167

Public Const xlWeekday = 2

Public Const xlWeekdayNameChars = 31

Public Const xlWhole = 1

Public Const xlWide = 3

Public Const xlWindows = 2

Public Const xlWJ2WD1 = 14

Public Const xlWJ3 = 40

Public Const xlWJ3FJ3 = 41

Public Const xlWK1 = 5

Public Const xlWK1ALL = 31

Public Const xlWK1FMT = 30

Public Const xlWK3 = 15

Public Const xlWK3FM3 = 32

Public Const xlWK4 = 38

Public Const xlWKS = 4

Public Const xlWMF = 2

Public Const xlWorkbook = 1

Public Const xlWorkbookNormal = -4143

Public Const xlWorkbookTab = 6

Public Const xlWorks2FarEast = 28

Public Const xlWorksheet = -4167

Public Const xlWorksheet4 = 1

Public Const xlWorksheetCell = 3

Public Const xlWorksheetShort = 5

Public Const xlWPG = 3

Public Const xlWQ1 = 34

Public Const xlX = -4168

Public Const xlXErrorBars = 10

Public Const xlXYScatter = -4169

Public Const xlXYScatterLines = 74

Public Const xlXYScatterLinesNoMarkers = 75

Public Const xlXYScatterSmooth = 72

Public Const xlXYScatterSmoothNoMarkers = 73

Public Const xlY = 1

Public Const xlYear = 4

Public Const xlYearCode = 19

Public Const xlYears = 2

Public Const xlYErrorBars = 11

Public Const xlYes = 1

Public Const xlZero = 2

Open in new window

0
 

Author Closing Comment

by:NormaPosy
Comment Utility
Thank you! Remarks:

1. I wondered what that const line was all about in your code.

2. How come my books don't mention this?

3. I deeply appreciate your help.

- - Norma
0
 
LVL 11

Expert Comment

by:kbirecki
Comment Utility
Regarding books mentioning constants, they do, but depending on what book you are reading, if it is an Excel VBA book, those constansts are intrinsic (meaning they are bult-in and available automatically.)  Since you are working in VB6, any VB6 book will focus on VB6 structure, syntax, VB6 intrinsic constants, etc.  Interoperability between apps requires you to understand both environments and their differences.  In this case, the constant you were using in VB6 were only intrinsic to Excel, thus they have to be defined in VB6.

My suggestion for any and all programming when troubleshooting is this: go "plain vanilla" - make no assumptions.  Using your situation as an example, if you either step through the code or output to the debug window (or a text file) the values of variables for each line, you will see exactly what is going on.  There are whole courses on proper design and development, independant of actually solving any problems with software.  It's a complex subject, don't let anyone tell you otherwise.  In my opinion, modern software tools that claim to make development of anything from traditional procedural code like VB6 to Object Oriented (OO) languages and so on, in all cases, to be good even with those, they require an understanding of what's going on under the hood.  Having a passion for what you do helps a lot!  

Good luck!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

762 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

7 Experts available now in Live!

Get 1:1 Help Now