Skip to content

Need to escape quotes prior to writing formula #89

@billdenney

Description

@billdenney

The first file below has an error when opening in Excel due to a quote that is not escaped. The second file works because the quote is escaped. I think that we should automatically escape any quotes in strings.

library(writexl)
df <- data.frame(website = xl_hyperlink("http://www.berkeley.edu", 'Berkeley "homepage'))
write_xlsx(df, 'test_error.xlsx')
df <- data.frame(website = xl_hyperlink("http://www.berkeley.edu", 'Berkeley ""homepage'))
write_xlsx(df, 'test_success.xlsx')

Created on 2025-09-15 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions