본문 바로가기
개발언어/VB

코드로 vaSpread 6.0 Currency형으로 설정하기

by 엔돌슨 2008. 1. 25.
반응형
직접해보았다 ㅠ

코드로 vaSpread 6.0 Currency형으로 설정하기

    ' 설정하기 (Currency형으로 지정)
    SS3.BlockMode = True
        SS3.Row = 1: SS3.Row2 = SS3.MaxRows
        SS3.Col = 2: SS3.col2 = SS3.MaxCols - 1
        SS3.CellType = CellTypeCurrency
        SS3.TypeCurrencyShowSymbol = False
        SS3.TypeCurrencyShowSep = True
        SS3.TypeCurrencyDecPlaces = 0
        SS3.TypeHAlign = TypeHAlignRight
    SS3.BlockMode = False



조금 참고한것~
http://www.clubfarpoint.com/Forums/forums/thread/13959.aspx

Perfomance problem setting cell type  (질문이란다 )
I have a spreadsheet consisting of 132 columns by a variable number of rows. In my test app, I'm generating 1095 rows. Before I load the data, I set the cell type using:

Private Sub InitialiseSpreadsheetColumns()

   '*** Format the data item number column
   oWhatif.Col = CELL_DATAITEM      ' Column 1
   oWhatif.Col2 = CELL_DATAITEM
   oWhatif.Row = 1
   oWhatif.Row2 = oWhatif.MaxRows
  
   oWhatif.BlockMode = True
      oWhatif.CellType = CellTypeNumber   ' Cell is a long
      oWhatif.TypeNumberDecPlaces = 0
   oWhatif.BlockMode = False
  
   '*** format the data item name column
   oWhatif.Col = CELL_DATAITEM_NAME   ' Column 2
   oWhatif.Col2 = CELL_DATAITEM_NAME
   oWhatif.Row = 1
   oWhatif.Row2 = oWhatif.MaxRows
  
   oWhatif.BlockMode = True
      oWhatif.CellType = CellTypeEdit   ' cell is static text
   oWhatif.BlockMode = False
   '*** format the data values columns
   oWhatif.Col = CELL_DATA_VALUES   ' Column 3 thru 132
   oWhatif.Col2 = oWhatif.MaxCols
   oWhatif.Row = 1
   oWhatif.Row2 = oWhatif.MaxRows
  
   oWhatif.BlockMode = True
      oWhatif.CellType = CellTypeCurrency      ' Cells are doubles
      oWhatif.TypeCurrencyShowSymbol = False
      oWhatif.TypeCurrencyDecPlaces = 10
      oWhatif.TypeCurrencyMin = -99999999999.99
      oWhatif.TypeCurrencyMax = 99999999999.99
      oWhatif.TypeHAlign = SS_ALIGN_RIGHT
   oWhatif.BlockMode = False
End Sub
(oWhatif is a spreadsheet control - nothing more than that).

However, this is taking around 7.5 seconds on a reasoably powerful machine. Am I doing something wrong, or is there a better way of initialising the columns?

Thanks
Steve Barnett