Parameters for font bold and alignment in Excel

Parameters for font bold and alignment in Excel

Imagen de selahattin

I work on some excel application in fortran.
y use Autosetproperty(range,"?????", value).
I look for the parameters to make bold the cell content and to align the content to center.
Do you have any idea or any reference.
regards

publicaciones de 10 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.
Imagen de Community Admin

First suggestion, as a reference, is naturally Autodice example in CVF but you're presumably gone through that. Required parameters, as for all Automation Servers, should be documented in the Server docs so a search within MSDN Excel developer's Kit should give some results/answers. I might be wrong but think that's boolean true/false parameter (for bold). As far as I can remember to justify text in a cell you have to use Justify method. Other good examples and sources of info you can find here.

Artur

Imagen de selahattin

Thanks for your reply.
But I couldn't neccessary information at the MSDN web site because information or samples are given using VB or VBA.
For example, it is ok to write only
HorizontalAlignment=XlRight, or XlCenter etc.
In our case, in fortran, it is required to assign a value to Xlcenter.
for instance, it is like -42620 (now y don't remember exact number) for XlRight.
I look for that value for Xlcenter, xlleft and the statement for fontbold.
Regards

Imagen de Community Admin

try these,

xlLeft= -4131
xlRight= -4152
XlCenter= -4108

Artur

Imagen de Jugoslav Dujic

You can find partial list of constants here. Translation to Fortran is trivial (replace #define with integer, parameter:: ). I think[http://download.microsoft.com/download/office95pro/constant/1/WIN98/EN-U... contains full list for Office.

Jugoslav www.xeffort.com
Imagen de Jugoslav Dujic

Sorry, wrong URLs. Should be here and wc0993.exe.

Jugoslav www.xeffort.com
Imagen de selahattin

Hi Arturguzik and Jugoslavdujic,
Thanks for your supports. It works with excel constants given by you. Perfect!
But, I can not still solve the border and fontbold problem.
I try with below code but it doesn't work.
Integer , parameter:: xledgebottom = 9
....
Satatus=AutoSetproperty(range, "Borders",xledgebottom)
Satatus=AutoSetproperty(range, "font.bold",.true.)
I put "Borders" and "font.bold" definitions by making analogy to VBA.
Do you have any idea?
Regards

Imagen de Community Admin

I've just tried to break trough the imported type library and dig it out. Maybe this will work (range, "RHS", .true.). If still fails I'll try to think of something else.
With borders I think that some parameters in your statement are missing.
Jugoslav, as always, will definitely be of much better assistance with this.

Artur

Imagen de canaimasoft

selahattin

The reason why you cannot set these "properties" is because they return objects; borders is a collection object and font is an object. You need to get a pointer to the font object before you can set its properties (of which bold is one). The same with the borders collection.

hope this helps,

regards,

Marco A. Garcia
Canaima Software, Inc.
www.canaimasoft.com

Imagen de selahattin

Hi Marco,
Thanks for your advice.
But, still I couldn't do it.
Would you like to give a code fragment shows this topic, please?
Thanks at advance.

Inicie sesión para dejar un comentario.