Problems when opening xlsx with openpyxl
Question: I have a xlsx file and I tried to load this file using openpyxl

    
    
    from openpyxl import load_workbook 
    wb = load_workbook('/home/file_path/file.xlsx')
    

But I get this error:

    
    
    "wb = load_workbook(new_file)"): expected string or buffer
    

new_file is a variable with the path of the xlsx file trying to open. Does
anybody knows why this happens or how I should change to read the file?
Thanks!

**Update** More details about the error

    
    
    /home/vagrant/scrapy/local/lib/python2.7/site-packages/openpyxl/reader/worksheet.py:322: UserWarning: Unknown extension is not supported and will be removed
      warn(msg)
    /home/vagrant/scrapy/local/lib/python2.7/site-packages/openpyxl/reader/worksheet.py:322: UserWarning: Conditional Formatting extension is not supported and will be removed
      warn(msg)
    Traceback (most recent call last):
      File "/vagrant/vagrant_conf/pycharm-debug.egg/pydevd_comm.py", line 1071, in doIt
        result = pydevd_vars.evaluateExpression(self.thread_id, self.frame_id, self.expression, self.doExec)
      File "/vagrant/vagrant_conf/pycharm-debug.egg/pydevd_vars.py", line 344, in evaluateExpression
        Exec(expression, updated_globals, frame.f_locals)
      File "/vagrant/vagrant_conf/pycharm-debug.egg/pydevd_exec.py", line 3, in Exec
        exec exp in global_vars, local_vars
      File "<string>", line 1, in <module>
      File "/home/vagrant/scrapy/local/lib/python2.7/site-packages/openpyxl/reader/excel.py", line 252, in load_workbook
        wb._named_ranges = list(read_named_ranges(archive.read(ARC_WORKBOOK), wb))
      File "/home/vagrant/scrapy/local/lib/python2.7/site-packages/openpyxl/workbook/names/named_range.py", line 130, in read_named_ranges
        if external_range(node_text):
      File "/home/vagrant/scrapy/local/lib/python2.7/site-packages/openpyxl/workbook/names/named_range.py", line 112, in external_range
        m = EXTERNAL_RE.match(range_string)
    TypeError: expected string or buffer
    


Answer: The syntaxe is:

    
    
    wb = load_workbook(filename='file.xlsx', read_only=True)
    

The `read_only` keyword is not required.

