Como puedo hacer un contador en OpenOffice Calc?
Publicado: Mié Jul 29, 2015 9:01 pm
				
				Tengo un archivo en Open Office Calc con casos de prueba, pero quiero hacer un contador en los macros, pero no se como?
Podria alguien ayudarme para hacer el contador?
basicamente el contador tiene que contar cuantos registros tengo.
y en el codigo tengo esto:
Que me hace falta para hacer que me cuente cuantos registros tengo?
			Podria alguien ayudarme para hacer el contador?
basicamente el contador tiene que contar cuantos registros tengo.
y en el codigo tengo esto:
Código: Seleccionar todo
Sub Main
 Dim oSheet : oSheet = ThisComponent.Sheets.getByName("TestCases") 
    Dim fs, f, i
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.CreateTextFile("C:\Temp\testfile.xml", True)
    
      
    f.WriteLine ("<sections>")
    f.WriteLine ("<sectiones>")
        
     
    for i = 2 To 10
 
     oCell = oSheet.getCellByPosition(1,i)
    f.WriteLine ("<case>" & oCell.getString & "")
     
     oCell = oSheet.getCellByPosition(2,i)
    f.WriteLine ("<Id>" & oCell.getString & "</Id>") 
          
      oCell = oSheet.getCellByPosition(3,i)
    f.WriteLine ("<Title>" & oCell.getString & "</Title>")     
              
       
     oCell = oSheet.getCellByPosition(4,i)
    f.WriteLine ("<Type>" & oCell.getString & "</Type>")
    
     oCell = oSheet.getCellByPosition(5,i)
    f.WriteLine ("<Priority>" & oCell.getString & "</Priority>")
    
     oCell = oSheet.getCellByPosition(6,i)
    f.WriteLine ("<Estimate>" & oCell.getString & "</Estimate>")
    
     oCell = oSheet.getCellByPosition(7,i)
    f.WriteLine ("<Milestone>" & oCell.getString & "</Milestone>")
    
     oCell = oSheet.getCellByPosition(8,i)
    f.WriteLine ("<References>" & oCell.getString & "</References>")
    
     oCell = oSheet.getCellByPosition(9,i)
    f.WriteLine ("" & oCell.getString & "</case>")
    
      Next i
    
    f.Close
End Sub