Delphi 7 Excel automation

None of the main categories make any sense for this post, but Excel is a form of reporting I guess, so I put it here. Fine if you decide to move it. Doesn't matter to me.

In Excel, you can select individual or groups of characters within a cell and modify their characteristics, such as bold, font color, font name, etc. I know how to do this in VBA in Excel and Access. I've tried to apply this idea to some automation I'm doing from within D7 but it's not working. My Excel file is created as expected in every way other than this.

OXL is a variant that is the workbook
oSheet is an variant variable that is the sheet. It works fine for the rest of my code so there's no issue there.
rteNum contains short alphanumeric values such as "ABC123" or "Bob5"
rteNum can also contain special characters that signify certain conditions. So it can also be like "ABC123 *" or "Bob5 #".  
I need the * and the # to be bold red while the rest of the cell stays non bold black. Again, this is easy to do in Excel itself.

      oSheet.Cells[i,2].Select;
      numCellChars := Length(rteNum);
      OXL.ActiveCell.Characters[numCellChars, 1].Font.FontStyle := 'Bold';
      OXL.ActiveCell.Characters[numCellChars, 1].Font.Color := -16776961;

The above code should bold/red the last character of the cell but it does nothing at all. No crash, it runs through each line, but the character does not change.

What's odd is that if I do this:

      OXL.ActiveCell.Characters[1, 1].Font.FontStyle := 'Bold';

the bolding works but it bolds the entire cell, not just the first character. And no matter what I do, the color does not change at all.

Any help would be appreciated.

Thanks,

Keith
0
Keith
7/21/2015 4:29:16 AM
embarcadero.delphi.reporting 487 articles. 0 followers. Follow

0 Replies
589 Views

Similar Articles

[PageSpeed] 19

Reply:

Similar Artilces:

Delphi 7 Excel automation [Edit]
None of the main categories make any sense for this post, but Excel is a form of reporting I guess, so I put it here. Fine if you decide to move it. Doesn't matter to me. In Excel, you can select individual or groups of characters within a cell and modify their characteristics, such as bold, font color, font name, etc. I know how to do this in VBA in Excel and Access. I've tried to apply this idea to some automation I'm doing from within D7 but it's not working. My Excel file is created as expected in every way other than this. OXL is a variant that is the workbook oShee...

Automating Excel 4.0 from Delphi 7
I need to write to a Excel 4.0 file and cannot use the Excel97 library. In fact, I cannot do it with Excel 2003 and 2003 SP3 either. All of the above corrupt the file. EXAMPLE: The Excel 4.0 file is 4 kb in size. If I Open and then Save the file, its size increases. It increases to 6 kb w/2003 and 5 kb w/97. I suspect extra overhead from latter Excel versions are being saved in the original file. I suspect the only way to save the file and actually no change it is to use Excel 4.0 for the entire handling. Thanks in advance, Tom ...

Delphi 7 to Delphi XE
Have been using Delphi 7 for many moons ( have got later versions but never upgraded to ) My first problem is: Component Palette. in XE it is a small toolbar docked in top right in Delphi 7 it gives a large view of all the components. I am struggling to be able to cope/access my components.in Delphi XE. Can I make the component pallette tool bar the same size as Delphi 7, or is there a fast way to view/choose all available components in XE, that I have not spotted yet? Kind Regards, Robert. Hi, What I know is that in Delphi 2010 and XE you can choose between t...

Delphi 7 to Delphi XE2
Hi, Still using that old workhorse, Delphi7, but am going to the conference in London hosted by Embarcadero on Delphi XE2. Although I would like to "move with the times" and am keen to get the UNICODE and 64-bit support offered by the latest IDEs, I confess to being more than a little scared about all the UNICODE/String/AnsiString and 32/64 bit issues I'm probably going to fall over. Anyone recently upgraded from Delphi7 to one of the latest Delphi IDEs? Thanks, Alain On 03/02/2012 08:55, Alain Dekker wrote: > Still using that old workhorse, Delphi7, but...

Delphi 2007 to Delphi 7
I've written a class in Delphi 2007 that is not supported in Delphi 7. What would be the best way to achive what I've done in Delphi 2007 in Delphi 7? Thanks, Tom type BondConstants = class { Bond Types } type BondType = record const TREASURY = 3; AGENCY = 0; CORP = 1; MUNI = 2; SBA = 5; MBS = 4; CMO = 6; end; { Day Count Methods } type DayCount = record const ACTUAL_360 = 2; ACTUAL_365 = 1; ACTUAL_ACTUAL = 1; d30_360 = 0; ...

I wrote an application and used cracked delphi 7, after i bought delphi 7
I wrote an application and used cracked delphi 7, I sold it, after i bought delphi 7 and recompiled application, is now my application legal or? > {quote:title=Ivan Ivanov wrote:}{quote} > I wrote an application and used cracked delphi 7, I sold it, after i bought delphi 7 and recompiled application, is now my application legal or? "I embezzled some money from my employer, returned the funds, and then got it back as a bonus. Can I still be arrested?" Uhhh .... didn't you just confess to a crime? > {quote:title=Ivan Ivanov wrote:}{quote} > I wrote an appli...

Using Delphi 7 and Delphi 2010
I had a project in Delphi 7. I worked on it in Delphi 2010. When I try to open the .dpr again in Delphi 7, the IDE toolbar widens across both monitors, and Delphi 7 locks up. It appears that Delphi 2010 modifies the .dpr in a way that makes Delphi 7 unable to open it again. All my forms & units appear to open fine in D7 after D2010, except for the warnings on the ExplicitHeight and ExplicitWidth properties being missing... I can easily recreate the .dpr, but is this expected behavior? Thanks. Tom Field wrote: > I had a project in Delphi 7. > > I worked o...

Moving from Delphi 7 to Delphi 2007
Is there any compelling reason to move (quite a large project) from Delphi 7 to Delphi 2007? Specifically, is there better Vista/Win7/Win8 integration provided by Delphi 2007? (In the project I am already using a custom manifest file for Vista/Win7 etc.. and not the std XPMan component) Does 2007 add any new bugs to the scene? Thanks Rael Rael wrote: > Is there any compelling reason to move (quite a large project) from > Delphi 7 to Delphi 2007? If you are going to upgrade, why not upgrade to something newer? > In the project I am already using a custom man...

Migrating From Delphi 7 to Delphi 2010
We did not know which forum was the best for this question. We have been wanting to migrate from Delphi 7 to a later version for years but it appears to be a daunting task. We first looked at D2006 and that was a radical new world. We bought D2010 a couple of years ago and not done much with it because there are so many parts to our applications. We have done a few new applications in D2010 and they seem to work okay. D2010 has not been impressive, perhaps because of the strangeness compared to D7. Is is possible for us to do a phased sort of migration where we do a form at a time? ...

Migrating from Delphi 7 to Delphi XE3
Hello, Its time to leave the old Delphi 7 and move to the new (but not the latest) XE3. I was wondering if there is a good book or reference to learn all new things XE3 added. Any suggestions? On 5/3/2013 10:17 PM, George Karatsiolis wrote: > Hello, Its time to leave the old Delphi 7 and move to the new (but not the latest) XE3. > I was wondering if there is a good book or reference to learn all new things XE3 added. Try this one for starters: http://tinyurl.com/cgsu243 Aside from that you really need to evaluate your application. XE3 is Unicode for example.... So her...

Delphi 2007 RTL in Delphi 7
I read somewhere that it is possible to use Delphi 2007's (or for that matter Delphi 2006's) RTL in Delphi 7 by just recompiling the source of RTL. Is this really possible? What are the benefits that we can derive using a higher version's RTL? TIA Yogi Yang Yogi Yang wrote: > I read somewhere that it is possible to use Delphi 2007's (or for > that matter Delphi 2006's) RTL in Delphi 7 by just recompiling the > source of RTL. If it actually compiles in Delphi 7, I guess it would be possible. OTOH, if one has Delphi 2007 already, I don't s...

Delphi 7 to Delphi 2009 conversion
Hello group, What do I need to do to comile the following code in D2009. Compiler error after the Else E2010: Incompatible Types 'AnsiChar' and 'Char' if isUnicode then SearchHandle := FindFirstFilew( PWideChar( fn ), FindDataW ) else SearchHandle := FindFirstFile( PAnsiChar( Ansistring( fn ) ), FindDataA ); <<<<<compiler error in the above line >>>>>>>>>>> Regards, Bryan > What do I need to do to comile the following code in D2009. > Compiler error after the Else > E2010: Incompati...

ANN: Delphi HTML Reports preview
Very simple to use - buid complex reports in 10 minutes. All you need to know - SQL, HTML, CSS. Use all power of HTML4 and CSS3 in any part of report. Features: Barcodes Multiline headers Groups Cross-tabs (any level) Transformations (cross-tab with range) Pictures (+from database) Master/Detail (any level) Supports all databases and db-libraries (writing adapter for any db-acess library takes only 5 minutes) Standalone reports - no need for delphi forms/datasets. 100% native Delhi code. All Delphi versions - from Delphi 6 to XE6 (VCL). 32/64 bit. Supports Unicode for...

Unofficial Delphi 7 updates
Anybody noticed, even tried this Enhanced Run Time library for Delphi ? It's a hack of the D7 RTL/VCL http://blog.synopse.info/post/2009/12/20/Enhanced-Run-Time-library-for-Delphi-7 It's very interesting and I'd like to know it's stability. Edwin Ye wrote: > Anybody noticed, even tried this Enhanced Run Time library for Delphi > ? It's a hack of the D7 RTL/VCL This library violates Delphi's license (redistributing of RTL/VCL source files is not allowed). The last post was deleted and I'm sure this one will be deleted, too. -- Andreas H...

Web resources about - Delphi 7 Excel automation - embarcadero.delphi.reporting

Automation - Wikipedia, the free encyclopedia
For a hierarchical presentation of automation topics, see Outline of automation . For other uses, see Automation (disambiguation) . Automation ...

Automation World - Covering the field of industrial automation
AutomationWorld.com delivers content for the Automation Buying team, which includes Information Technology and Networking; Operations and Engineering; ...

Facebook Ads API Partner AdStage: Campaign Automation, $6.25M Series A Funding
AdStage , a Facebook ads API partner, announced Wednesday the launch of campaign automation — as well as a $6.25 million round of Series A funding. ...

Facebook PMD IgnitionOne launches self-service marketing automation
IgnitionOne , a Facebook Preferred Marketing Developer, announced Tuesday the launch of the Marketing Automation tool. A fully integrated module ...

Automation Heroes (@automationhero) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Automation World
Automation World is your link to the why and how of manufacturing automation. The purpose of this group is to connect manufacturing engineers,... ...

Young people don't consider automation issues when choosing a career
... launched a new research study that determines that almost half (49 percent) of young people in Britain are not taking the issue of job automation ...

Meet Microbot Push, a home automation gadget lazy people will love
A South Korean startup called Naran has come up with an incredibly clever way for users to control and automate any type of switch-oriented task ...

Robots Will Change World Beyond Recognition Says BoA; Automation Will Change Jobs More Than Kill Them ...
Robot Theory The battle of robot theory is on. Bank of America paints one picture and McKinsey another. Let's investigate both theories. Automation ...

Rockwell Automation Announces Mobility Co-Innovation with Microsoft
A new mobility co-innovation project by Rockwell Automation and Microsoft Corp. will be demonstrated at Automation Fair in Chicago Nov. 18 and ...

Resources last updated: 12/7/2015 10:50:52 PM