> I figured if I could write the file with some control
> character and then execute a Replace for the control
> character to the ' character (which, in Excel, denotes
> a force-text) then it will work. I've done it manually,
> recording a macro, and I can't get the Replace funciton
> to run when I try and do it through the Com object.
>
> The reason I have to do the replace is because the
> auto-conversion is happening the miunute Excel opens the file.
I know the limitations of Excel for numeric looking pieces of text -
it's a NIGHTMARE!
OK, first of all, I wouldn't use ' as the delimiter as you might have a
description something like "Hatton's Item" - paranoia, but it might
happen
Now here's where you're probably going to start kicking yourself at how
easy this is
objRange = objExcel.Cells;
objRange.Replace("'", "");
The objExcel.Cells says "We're working on all cells in this sheet"
The objRange.Replace() has 2 main parameters, "from" an "to"
That's it - it's really that simple <g>
Philip Arnold
Technical Director
Certified ColdFusion Developer
ASP Multimedia Limited
Switchboard: +44 (0)20 8680 8099
Fax: +44 (0)20 8686 7911
www.aspmedia.co.uk
www.aspevents.net
An ISO9001 registered company.
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
> -----Original Message-----
> From: Hatton Humphrey [mailto:[EMAIL PROTECTED]]
> Sent: 21 May 2002 20:01
> To: CF-Community
> Subject: Re: Where to Send?
>
>
> Thanks for the responses.
>
> Bascially here is my problem:
> I have a page that I use to export a list of parts to an Excel file.
> I'm using the CF_HTML2EXCEL tag that connects to the Excel
> COM object.
> What it does is save the HTML between the start and end tags as a
> temporary HTML file, open it up in Excel and do a SaveAs excel file.
>
> This has worked like a charm until I realized that if the
> part numbers
> (in the dB as VarChar) are all-numeric then when Excel opens
> the file it
> is converting all of the cells to General format and then
> when it sees
> the numeric value, converting the general to a number. Where
> the part
> numbers are 0004567 and 000000 (the client's way of saying "No Part
> Number"), they get to the HTML file correctly but then in the
> opening,
> excel works it's magic and I get 4567 and 0.
>
>
> Thanks again!
> Hatton
>
> Philip Arnold - ASP wrote:
>
> >>I'm wondering if I'm posting a question in the right place.
> >>
> >>Yesteday I posted an Excel COM object question (interacting
> >>with Excel
> >>via it's COM object using CF... I need to run a Replace and
> >>can't get it
> >> to work right). I posted the question to CF-Talk and also
> >>on CFComet.com.
> >>
> >>Any ideas where else I should post it or should I just shutup and be
> >>patient?
> >>
> >
> > What's the question? I'm OK with Excel COM (not touched it for a few
> > months, but I should be able to dig it out)
> >
> > Philip Arnold
> > Technical Director
> > Certified ColdFusion Developer
> > ASP Multimedia Limited
> > Switchboard: +44 (0)20 8680 8099
> > Fax: +44 (0)20 8686 7911
> >
> > www.aspmedia.co.uk
> > www.aspevents.net
> >
> > An ISO9001 registered company.
> >
> >
> **********************************************************************
> > This email and any files transmitted with it are confidential and
> > intended solely for the use of the individual or entity to whom they
> > are addressed. If you have received this email in error
> please notify
> > the system manager.
> >
> **********************************************************************
> >
> >
> >
>
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists