vb .net 2003 open excel app and format a column to a text or date type

Posted on 2007-10-19
Last Modified: 2012-08-14
vb .net 2003.  When calling an excel application and writing data to the workseet.  How do you format a column to text or date or general?
Question by:mphillip85
    LVL 48

    Expert Comment

    You can do it this way

        ' To number
        YourWorkCell.NumberFormat = "@"
        ' To Date
        YourWorkCell.NumberFormat = "m/d/yyyy"

    Author Comment

    I need more of the text format because I have an account number that is preceeded with zeros, so not to let excel strip the zeros I need to format the column as text.

    LVL 48

    Accepted Solution


    This is text format YourWorkCell.NumberFormat = "@". For number format you use YourWorkCell.NumberFormat = "0.00"


    Featured Post

    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

    Join & Write a Comment

    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    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.

    746 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

    15 Experts available now in Live!

    Get 1:1 Help Now