Hi
Can anyone share a code snippet to allow me to do this in Calc? In Excel, I use
oSheet:Range(aColumns[16]+"5:"+aColumns[16]+ltrim(str(nRow))):NumberFormat := "####0.0000"
I looked at ToCalc in xBrowse but I'm lost
TIA
David
oSheet:GetColumns():GetByIndex( nCol-1 ):NumberFormat:=GetNumberFormatId(oBook, cNumberFormat, cType) // Returns nFormatID
// Function GetNumberFormatId(oBook, cNumberFormat, cType)
cCharLocale = oBook:GetPropertyValue("CharLocale")
nFormatId = oBook:GetNumberFormats:QueryKey(cNumberFormat, cCharLocale, .F.)
// if nFormatID is -1, then it means that this particular format is not available and you need to add the format.
// For this you can use the following code
IF nFormatId = -1 // 'Format is not yet defined
TRY
nFormatId = oBook:GetNumberFormats:AddNew(cNumberFormat, cCharLocale)
CATCH
MsgInfo( "Could not set the format" + " " + cNumberFormat )
END
ENDIF
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 99 guests