I’ve dealt with this issue before and discovered a workaround that may help. Instead of using the export URL directly, create a temporary spreadsheet and copy only the values and formatting from the original sheet. I first generated a new spreadsheet, transferred the necessary data while omitting formulas, exported the temporary sheet as an Excel file, and then removed the temporary file. Although this process may slow down large spreadsheets, it guarantees that only values and formatting are included. For better performance with big files, consider using the Sheets API for more control.
hey luna, i’ve had similar issues. try using the getValues() method to grab just the data, then create a new sheet with those values. export that new sheet instead. it’s a bit roundabout but should work. let me know if u need more help!
To export Google Sheets as Excel with only values and formatting, you can modify your script to use the Advanced Sheets Service. This approach allows more control over the export process. First, enable the Advanced Sheets Service in your Apps Script project. Then, use the Sheets.Spreadsheets.get method to retrieve the spreadsheet data, and Sheets.Spreadsheets.batchUpdate to clear formulas. Finally, export the modified sheet. This method is more efficient for larger spreadsheets and provides precise control over the exported content. Remember to handle potential API quota limits if you’re working with numerous or very large sheets.