title: name 'openpyxl' not defined error
body: <p>Still learning the ins and outs of python here.  I've had minor success with using openpyxl library and started this pet project of using excel file as a "canvas" to read a 1 bit bmp file from directory then to "duplicate-display" the image on the worksheet by getting rid of the guides, decreasing the sizes of each cell and finally by adding a small image in each cell with list of binary data from getdata method from pillow.</p>
  
  <p>I have not gone through the entire logic, but I am having trouble with below code for two nights and I still have no clue why I am getting name 'openpyxl' not defined error in the line almost at the bottom withe the code <code>sheet.add_image(openpyxl.drawing.image.Image('square_blue.jpg'), colnum_string(col)+str(row))</code>
  I had success with similar project using almost identical importing of both openpyxl and PIL libraries.</p>
  
  <pre><code>from openpyxl import Workbook
  import os
  from PIL import Image
  # for file in os.listdir():
  #   if file.endswith('bmp'):
  os.chdir('c:/users/Sam/Desktop/py')
  img = Image.open('trump.bmp')
  
  img_width, img_height = img.size
  pix_val = list(img.getdata())
  
  wb = Workbook()
  
  def colnum_string(n):
      string = ""
      while n &gt; 0:
          n, remainder = divmod(n - 1, 26)
          string = chr(65 + remainder) + string
      return string
  
  r_height = 3
  c_width = 3
  
  sheet = wb.create_sheet("Mysheet")
  for col in range(1, img_height):
      sheet.row_dimensions[img_height].height = r_height
      for row in range(1, img_width):
          sheet.column_dimensions[colnum_string(col)] = c_width
  
          sheet.add_image(openpyxl.drawing.image.Image('square_blue.jpg'), colnum_string(col)+str(row))
  
  wb.save('out.xlsx')
  </code></pre>
  
  <p>Can anyone help me out please?</p>