ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Tool_Box/ExcelLib.py
(Generate patch)

Comparing Python/NinoCode/Tool_Box/ExcelLib.py (file contents):
Revision 648 by nino.borges, Wed Jan 21 22:41:40 2015 UTC vs.
Revision 649 by nino.borges, Thu Dec 12 20:42:20 2019 UTC

# Line 35 | Line 35 | class ExcelConnection:
35          "Get Value of one Cell"
36          sht = self.xlBook.Worksheets(sheet)
37          return sht.Cells(row,col).Value
38 +    
39      def setCell(self, sheet, row, col, value):
40          "set value of one cell"
41          sht = self.xlBook.Worksheets(sheet)
# Line 45 | Line 46 | class ExcelConnection:
46          sht = self.xlBook.Worksheets(sheet)
47          return sht.Range(sht.Cells(row1,col1), sht.Cells(row2,col2)).Value
48  
49 <    def setRange(self, sheet, leftCol, topRow, data):
49 >    def setRange(self, sheet, leftCol, topRow, data, sheetRenameValue = None):
50          """insert a 2d array starting at given location.
51 <        works out the size needed for itself"""
52 <        bottomRow = topRod + len(data)-1
51 >        works out the size needed for itself. optionally you can rename the sheet."""
52 >        bottomRow = topRow + len(data)-1
53          rightCol = leftCol + len(data[0]) -1
54          sht = self.xlBook.Worksheets(sheet)
55          sht.Range(
56              sht.Cells(topRow, leftCol),
57              sht.Cells(bottomRow, rightCol)).Value = data
58 +        if sheetRenameValue:
59 +            sht.Name = sheetRenameValue
60  
61      def getContiguousRange(self, sheet, row, col):
62          """Tracks down and across from top left cell until it

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)