DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2007
    Posts
    1

    Question Problem :SICK: Unable to Set Text Property of Range Class

    Hi i Have tried dMuch to set the Value In THe excel sheet from VIasual Basic But Cant Set .the Value Are Stored in Excel as a number i.e. Cell Format is in Number. I Want to Change The Format of Cell To Text

    OR

    Set The Following Value in the Excel Sheet.

    oSheet.Range("B2").Value = "0002e001"
    plz try it. the VAlue Stored in Excel Sheet is :2.00 e 001


    Reply Immediately

  2. #2
    Join Date
    Aug 2004
    Location
    Orange, California
    Posts
    1,252
    Excel thinks it is a number in scienctific notation because of the 'e' which is the exponent seperator. Try forcing the numeric format to be a string like this:
    oSheet.Range("M3").Cells().NumberFormat = "@"
    oSheet.Range("M3").Value = "0002e001"

  3. #3
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Or simply precede the number with a single quote:

    oSheet.Range("M3").Value = "'0002e001"
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Triangle Property (class)
    By geo039 in forum .NET
    Replies: 2
    Last Post: 12-13-2006, 01:52 PM
  2. Getting a GUI to run
    By Eric in forum Java
    Replies: 4
    Last Post: 04-14-2006, 09:09 AM
  3. Assigning a TextBox Control via a Class Property
    By Miles Tones in forum VB Classic
    Replies: 2
    Last Post: 06-30-2005, 12:57 PM
  4. Replies: 0
    Last Post: 04-26-2001, 10:01 PM
  5. simple XML APPENDING problem
    By scopee in forum XML
    Replies: 4
    Last Post: 04-13-2001, 03:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links