You can use xlwings library which runs excel in the background and gives access to the Excel VBA API
Code extracts the text from all text boxes
import xlwings as xw
def get_text(shape):
text = []
if shape.Type == 6:
for item in shape.GroupItems:
text.extend(get_text(item))
elif shape.Type == 17:
text.append(shape.TextFrame2.TextRange.Text)
return text
excel_file = IN[0]
with xw.App(visible=False) as app:
wb = xw.Book(excel_file)
output = {}
for sheet in wb.api.Sheets:
for shp in sheet.Shapes:
output.setdefault(sheet.Name, []).append(get_text(shp))
OUT = output
My post on installing python libraries to Dynamo
