Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with blank strings in write_rich_string() #425

Closed
jmcnamara opened this issue Apr 6, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@jmcnamara
Copy link
Owner

commented Apr 6, 2017

If one of the string parts of a rich string is blank the resulting Excel file will raise a warning "We found a problem with some content in 'file.xlsx'...".

import xlsxwriter

workbook = xlsxwriter.Workbook('rich_strings.xlsx')
my_work_sheet = workbook.add_worksheet()

my_work_sheet.set_column('A:A', 50)

format_1 = workbook.add_format({'color': 'red'})
format_2 = workbook.add_format({'color': 'blue'})


my_work_sheet.write_rich_string(0, 0, 
                                format_1, "Some text in format 1 ", 
                                format_2, "", 
                                format_1, "Again in format 1")

workbook.close()

Originally reported on StackOverflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.