Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Where do you assign a value to xlsfile?

Where do you assign a value to xlsfile?

To elaborate: 'r' is specifying read on an existing file.

From the documentation: (1) When used to create new Excel files or add worksheets to existing Excel files: testxls = excelpy.workbook() testxls = excelpy.workbook(r"c:\working dir\ex1.xls") testxls = excelpy.workbook(r"c:\working dir\ex1.xls", "MySheet") or testxls = excelpy.workbook(r"c:\working dir\ex1.xls", "MySheet", False) or testxls = excelpy.workbook(r"c:\working dir\ex1.xls", "MySheet", False, 'w') or testxls = excelpy.workbook(xlsfile=r"c:\working dir\ex1.xls", sheet="MySheet", overwritesheet=False, mode='w') (2) When used to read existing Excel files: testxls = excelpy.workbook(r"c:\working dir\ex1.xls", mode='r')

Where do you assign a value to xlsfile?

To elaborate: 'r' is specifying read on an existing file.

From the documentation: documentation:

(1) When used to create new Excel files or add worksheets to existing Excel files:
testxls = excelpy.workbook()
testxls = excelpy.workbook(r"c:\working dir\ex1.xls")
testxls = excelpy.workbook(r"c:\working dir\ex1.xls", "MySheet") or
testxls = excelpy.workbook(r"c:\working dir\ex1.xls", "MySheet", False) or
testxls = excelpy.workbook(r"c:\working dir\ex1.xls", "MySheet", False, 'w') or
testxls = excelpy.workbook(xlsfile=r"c:\working dir\ex1.xls", sheet="MySheet",
overwritesheet=False, mode='w')
(2) When used to read existing Excel files:
testxls = excelpy.workbook(r"c:\working dir\ex1.xls", mode='r')

mode='r')