[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Trying to understand microsoft com object

Posted on 2004-04-29
6
Medium Priority
?
402 Views
Last Modified: 2010-04-05
Im currently trying to work out how I can translate what I read in the excel com object in VBA and workout how to call from excel

I can currently open a new workbook and write data to it fine, but now Im trying to work out how to format cells.
For example, a simple underline for a cell, I read in the com object the line
ActiveCell.Font.Underline = xlUnderlineStyleSingle
I tried doing oSheet.Cells[1,1].Font.Underline := xlUnderlineStyleSingle;
where oSheet is my active sheet, and obviously delphi didnt understand xlUnderlineStyleSingle
Does anyone have a place on the web I might be able to find direct translations,
or have a quick-fire method for me to understand
0
Comment
Question by:mikelittlewood
[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
  • 2
  • 2
6 Comments
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 10947642
0
 
LVL 12

Assisted Solution

by:Ivanov_G
Ivanov_G earned 200 total points
ID: 10947662

   also Project / Import Type Library
   select Microsoft Excel 10
   Create Unit

   check if you have

         C:\Program Files\Borland\Delphi7\Ocx\Servers\excel97.pas
0
 
LVL 23

Accepted Solution

by:
Ferruccio Accalai earned 200 total points
ID: 10947953
i don't remember where i've found these units for word and excel constants translations for Delphi....BTW i use them succesfull....

unit ExcelConst;

interface

Const
xlCenter=-4108;
xlLeft=-4131;
xlRight=-4152;
xlDistributed=-4117;
xlJustify=-4130;
xlNone=-4142;
{HorizontalAlignment}
xlHAlignCenter=-4108;
xlHAlignDistributed=-4117;
xlHAlignJustify=-4130;
xlHAlignLeft=-4131;
xlHAlignRight=-4152;
{In addition, for the Range or Style object}
xlHAlignCenterAcrossSelection=7;
xlHAlignFill=5;
xlHAlignGeneral=1;

{VerticalAlignment}
xlVAlignBottom=-4107;
xlVAlignCenter=-4108;
xlVAlignDistributed=-4117;
xlVAlignJustify=-4130;
xlVAlignTop=-4160;

{Borders}
xlInsideHorizontal=12;
xlInsideVertical=11;
xlDiagonalDown=5;
xlDiagonalUp=6;
xlEdgeBottom=9;
xlEdgeLeft=7;
xlEdgeRight=10;
xlEdgeTop=8;

{LineStyle}
xlContinuous=1;
xlDash=-4115;
xlDashDot=4;
xlDashDotDot=5;
xlDot=-4118;
xlDouble=-4119;
xlSlantDashDot=13;
xlLineStyleNone=-4142;

{Weight}
xlHairline=1;
xlThin=2;
xlMedium=-4138;
xlThick=4;

{ColorIndex}
xlColorIndexAutomatic=-4105;
xlColorIndexNone=-4142;

{Background}
xlBackgroundAutomatic=-4105;
xlBackgroundOpaque=3;
xlBackgroundTransparent=2;

{Underline}
xlUnderlineStyleNone=-4142;
xlUnderlineStyleSingle=2;
xlUnderlineStyleDouble=-4119;
xlUnderlineStyleSingleAccounting=4;
xlUnderlineStyleDoubleAccounting=5;

implementation

end.

unit WordConst;

interface

Const
{----MoveRight(Unit, Count, Extend)}
{Unit}
wdCharacter=1;
wdWord=2;
wdSentence=3;
wdCell=12;
wdAdjustNone=0;
wdOrientPortrait=0;
wdOrientLandScape=1;
wdAlignParagraphCenter=1;
wdAlignParagraphLeft=0;
wdAlignParagraphRight=2;
{Extend}
wdMove=0;
wdExtend=1;
wdBorderHorizontal=-6;
wdBorderVertical=-5;
wdLineStyleNone=0;
wdLine=5;
implementation

end.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 15

Author Comment

by:mikelittlewood
ID: 10950547
Excellent

Combining Ivanov_G
   also Project / Import Type Library
   select Microsoft Excel 10
   Create Unit

and data from Ferruccio68,
I can see where Ferruccio68 got his numbers from (converting the hex value in the excel com object file to decimal)

I havent imported the file Ivanov_G and set it in my uses clause as Im not doing too much, so Im just using the decimal numbers.

Thanks to both, I am spliting the points for the 2 of you.
0
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 10950650
Glad to have helped you :)

F68 ;-)
0
 
LVL 15

Author Comment

by:mikelittlewood
ID: 10957797
I think the hard part for me is that I havent done much COM before.
Trying to work out what calls I need to make from delphi to the com objects is a little difficult.
Not sure if there is an easy way or not.

For example, took me a while just to work out how to make a cell bold (lol)
And that was only because I stumbled on an example.
sheet.cell.font.fontstyle := bold;
0

Featured Post

Technology Partners: 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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

656 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