Ken, You build the format and assign the different attributes to it (one of which can be the locked flag, a font etc).
$ YourDefinedFormat:=xlBookAddFormat ($xlBook) $font:=xlBookAddFont ($xlBook) xlFormatSetFont ($YourDefinedFormat;$font) xlFontSetName ($font;"Arial") xlFontSetSize ($font;10) xlFormatSetLocked( $YourDefinedFormat; 1 ) Then, when you assign a cell value, you also assign the format as in: xlSheetSetCellNumber ($sheet;$row;$col;$cellData;$YourDefinedFormat) HTH Lahav -----Original Message----- From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Ken Eyring via 4D_Tech Sent: Wednesday, May 27, 2020 8:55 PM To: 4d_tech@lists.4d.com Cc: Ken Eyring <lis...@intrinetsystems.com> Subject: Re: Pluggers XL_Plugin Format Question Thanks for responding Doug. I looked at the code but did not see anything that jumped out at me regarding formatting. I look forward to seeing your sample code when you have a chance! Very much appreciated! Ken On 05/27/20 9:41 PM, Douglas von Roeder via 4D_Tech wrote: > Ken: > > I haven’t used that particular format but I suspect that it is used > like the other formats. If you haven’t created formats, check the code > in the demo. It’s not extensive but, if you hold your head just right, > things will make sense. > > At the moment, I’m away from a computer but I’ll post some code in the AM. > > On Wed, May 27, 2020 at 6:03 PM Ken Eyring via 4D_Tech > <4d_tech@lists.4d.com> > wrote: > >> I'm taking a look at buying the Pluggers XL_Plugin and most of my >> test went very quickly. Looks like a spectacular plugin. >> >> It was real easy to open a spreadsheet and insert values into >> specific cells. >> >> I ran into some confusion though, when I tried to set a cell's >> format, e.g. to Locked, or change the font name or font size, etc... >> >> Here are the instructions for xlFormatSetLocked, but I'm not sure >> what to pass in: >> >> xlFormatSetLocked( format ; locked ) >> → longint → integer >> Sets the locked protection property: 1 - true, 0 - false. >> >> I expected to define a sheet, row and column to identify the cell I >> wanted to set the format for - but I don't see how to define which >> cell I want to affect. >> >> If someone wouldn't mind sending a simple snippet of code that shows >> how to set a specific cell's format using this plugin I would really >> appreciate it. >> >> Thanks, >> Ken >> >> ********************************************************************* >> * >> 4D Internet Users Group (4D iNUG) >> New Forum: https://discuss.4D.com >> Archive: http://lists.4d.com/archives.html >> Options: https://lists.4d.com/mailman/options/4d_tech >> Unsub: mailto:4d_tech-unsubscr...@lists.4d.com >> ********************************************************************* >> * > ********************************************************************** 4D Internet Users Group (4D iNUG) New Forum: https://discuss.4D.com Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com ********************************************************************** ********************************************************************** 4D Internet Users Group (4D iNUG) New Forum: https://discuss.4D.com Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **********************************************************************