?
Solved

Excel.Application casting data types

Posted on 2003-02-25
2
Medium Priority
?
197 Views
Last Modified: 2012-08-13
I'm using Excel.Application to create a spreadsheet from within an asp page. One of the columns contains 5 character codes which should be treated as text, but sometimes they are numeric and have leading zeros, which Excel removes when the spreadsheet is opened. How do I cast the data type of this column as text so that the zeros will be displayed?
0
Comment
Question by:jennieh
[X]
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
2 Comments
 
LVL 7

Accepted Solution

by:
lavinder earned 300 total points
ID: 8015265
Hi

 simply use something like this
 e.g. sets the second column's format to text

 activesheet.Columns("B:B").Select
 Selection.NumberFormat = "@"

cheers!!
0
 

Author Comment

by:jennieh
ID: 8015536
I used the following and it worked:

m_oExcelWS.Range("F:F").NumberFormat = "@"

Thanks very much!!!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

770 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