<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Lesson 42
Step1:  We must first nagivate to the directory containing the spreadsheets, which for this notebook is the subdirectory 'files'.
Step2:  We must now open the workbook file.
Step3:  Once the workbook is loaded, we can interact with specific sheets by loading them via workbook methods.
Step4:  We can also use the .get_sheet_names() method to print all sheet names, in case we aren't sure.
Step5:  We can now interact with specific cells by creating cell objects, referenced via a sheet method.
Step6:  The .value method returns the actual value in the cell.
Step7:  This particular cell returns a datetime reference from Excel via Python's own datetime module. A string value is available by passing into the str() function
Step8:  All cell values inherit their data types from Excel.
Step9:  You can also reference cells via rows and columns. Excel rows start at 1 and columns at A.
Step10:  This can be useful for iterative or looping operations.
<ASSISTANT_TASK:>
Python Code:
import openpyxl
Explanation: Lesson 42:
Reading Excel Spreadsheets
The openpyxl module allows you to manipulate Excel sheets within Python. 
Excel files have the following terminology: 
* A collection of sheets is a workbook, and saved with a .xlsx extension.
* A workbook contains multiple sheets, each of which is a single spreadsheet, or worksheet. 
* Each sheet has columns and rows, defined by letters and numbers respecitvely.
* The intersection between a column and a row is a cell.
End of explanation
# Import OS module to navigate directories
import os
# Change the directory to the excel file location, using relative and absolute paths as previously discussed.
os.chdir('files')
os.listdir()
Explanation: We must first nagivate to the directory containing the spreadsheets, which for this notebook is the subdirectory 'files'.
End of explanation
workbook = openpyxl.load_workbook('example.xlsx')
type(workbook)
Explanation: We must now open the workbook file.
End of explanation
sheet = workbook.get_sheet_by_name('Sheet1')
type(sheet)
Explanation: Once the workbook is loaded, we can interact with specific sheets by loading them via workbook methods.
End of explanation
workbook.get_sheet_names()
Explanation: We can also use the .get_sheet_names() method to print all sheet names, in case we aren't sure.
End of explanation
# Just references an object exists; requires an additional method to interact with
sheet['A1']
Explanation: We can now interact with specific cells by creating cell objects, referenced via a sheet method.
End of explanation
cell = sheet['A1']
cell.value
Explanation: The .value method returns the actual value in the cell.
End of explanation
print(str(cell.value))
print(str(sheet['A1'].value))
Explanation: This particular cell returns a datetime reference from Excel via Python's own datetime module. A string value is available by passing into the str() function:
End of explanation
print("The value in cell %s is '%s' and is type %s." %('A1', sheet['A1'].value, type(sheet['A1'].value)))
print("The value in cell %s is '%s' and is type %s." %('B1', sheet['B1'].value, type(sheet['B1'].value)))
print("The value in cell %s is '%s' and is type %s." %('C1', sheet['C1'].value, type(sheet['C1'].value)))
Explanation: All cell values inherit their data types from Excel.
End of explanation
# B1 Cell
sheet.cell(row = 1, column = 2)
Explanation: You can also reference cells via rows and columns. Excel rows start at 1 and columns at A.
End of explanation
for i in range(1,8):
    print(i, sheet.cell(row=i, column=2).value)
Explanation: This can be useful for iterative or looping operations.
End of explanation
<END_TASK>