VB.net code do the simple operation of twitching "Axis Type" from automatic to "Date axis".

I've got some code which populates events over time on an excel sheet. At the end of the process my program creates a chart using the following code

Imports Excel = Microsoft.Office.Interop.Excel

 Dim xlApp As Excel.Application = New Microsoft.Office.Interop.Excel.Application()
    Dim xlWorkBook As Excel.Workbook = Nothing
    Dim xlWorkbooks As Excel.Workbooks = Nothing
    Dim xlWorkSheet As Excel.Worksheet = Nothing

    Dim chartPage As Excel.Chart
    Dim xlCharts As Excel.ChartObjects
    Dim myChart As Excel.ChartObject
    Dim chartRange As Excel.Range

xlCharts = xlWorkSheet.ChartObjects
        myChart = xlCharts.Add(10, 80, 900, 500)
        chartPage = myChart.Chart
        chartRange = xlWorkSheet.Range("B1", "d100")
        chartPage.SetSourceData(Source:=chartRange)
        chartPage.ChartType = Excel.XlChartType.xlBarStacked

How do I, in VB.net code do the simple operation of twitching "Axis Type" from automatic to "Date axis". This is usually found by clicking the vertical axis of a chart, format axis, axis options - date axis.

Is there a resource to find these commands?

Best regards,

Sean
Sean KilburnAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rgonzo1971Commented:
Hi,

pls try something like this
With chartPage.Axes(Excel.XlAxisType.xlCategory)
     .categorytype = Excel.XlCategoryType.xlTimeScale
     .BaseUnit = Excel.XlTimeUnit.xlDays
End With

Open in new window

Regards
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sean KilburnAuthor Commented:
Absolute legend. Worked straight away!!

Just as a side question, is there a resource you use to find these commands?

Thanks again for your help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.