Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
DMoe
 
Posts: n/a
Default Excel - Rendering ASCII via ASP/JScript

The project I'm working on currently uses a ASP/JScript combination to
popuate a CSV file. The file is then parsed into excel. I've written a
function that handles some of the whitespace characters (via regular
expressions) that mess up how the data is displayed in the cells. Often, the
hidden char(10) and char(13) would push the data to another row. Due to the
way that this is written right now, I'm also searching for commas and
replacing them with the ASCII version as well as some other things to handle
data formatting. Due to the way these are put into the excel document they
aren't rendered as commas or anything else other than plain text. i.e Doe,
John would be rendered as Doe , John. So my question is, is there a way to
insert the ASCII code into the CSV file and have it be rendered in Excel as
its regular readable character. I'm aware that when parsing Excel tends to
infer that most of the input is text and as a result wont convert anything.
Is there a way around this programatically? If there isnt, is there a way to
include a macro that will run through the page and do ther conversion? I
realize this is kind of out there but I'm just looking for a solution to this
problem without having to re-write everything into an XML deal.
  #2   Report Post  
Jon Peltier
 
Posts: n/a
Default

I'd take a different approach. I'd read the file in VBA, parse it there,
where I can control it, read non-printing characters, etc., then pass it
from VBA into the worksheet.

There used to be a decent article about File I/O on the MS web site, but
I can't find anything over there any more. Here are a few small articles
that tell only part of the story.

http://support.microsoft.com/?kbid=209231
http://support.microsoft.com/default...b;en-us;213642
http://support.microsoft.com/default...b;en-us;151262
http://msdn.microsoft.com/library/de...ssingfiles.asp
http://msdn.microsoft.com/library/de.../D6/S5B27D.asp

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

DMoe wrote:
The project I'm working on currently uses a ASP/JScript combination to
popuate a CSV file. The file is then parsed into excel. I've written a
function that handles some of the whitespace characters (via regular
expressions) that mess up how the data is displayed in the cells. Often, the
hidden char(10) and char(13) would push the data to another row. Due to the
way that this is written right now, I'm also searching for commas and
replacing them with the ASCII version as well as some other things to handle
data formatting. Due to the way these are put into the excel document they
aren't rendered as commas or anything else other than plain text. i.e Doe,
John would be rendered as Doe , John. So my question is, is there a way to
insert the ASCII code into the CSV file and have it be rendered in Excel as
its regular readable character. I'm aware that when parsing Excel tends to
infer that most of the input is text and as a result wont convert anything.
Is there a way around this programatically? If there isnt, is there a way to
include a macro that will run through the page and do ther conversion? I
realize this is kind of out there but I'm just looking for a solution to this
problem without having to re-write everything into an XML deal.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
html to excel nellie Excel Discussion (Misc queries) 4 February 8th 05 10:37 PM
Excel error - Startup (and Acrobat PDFMaker) gxdata Setting up and Configuration of Excel 0 February 4th 05 03:44 AM
Merge from Excel to Excel dalstar Excel Discussion (Misc queries) 3 January 30th 05 02:37 PM
Shortcut file fails to open JimH Excel Discussion (Misc queries) 3 January 15th 05 10:13 PM
pivotcell object to excel 2000 Kellyc Excel Discussion (Misc queries) 0 December 1st 04 03:45 PM


All times are GMT +1. The time now is 09:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"