Hi,
I have a workbook containing an external data connection: a simple SELECT statement from a SQL Server, that fills a worksheet.
I need to open this file with Aspose.Cells, refresh data and save the file. I didn’t find any Refresh() function on DataConnections or ListObjects classes.
I’ve set RefreshOnLoad property in Excel but the file isn’t refreshed when opening via Aspose, it is only resfreshed when opening with Excel.
Thank you in advance for your help
Jerome
Hi,
Thanks for your posting and using Aspose.Cells.
Aspose.Cells cannot fetch data from database. However, Microsoft Excel can do so. So refresh on load should work ok. Will you please share your console application project? It will be helpful, if you share a simple excel file, simple data and simple sample code so that we could investigate and fix this issue easily and speedily. Thanks for your cooperation in this regard. Have a good day.
Hi,
Thank you for your answer. You will find attached the file “example.xslx”, it contains an external connection to a database.
My code is just :
using (Workbook wb = new Workbook(EXCEL_FILE))
{
wb.CalculateFormula();
wb.Save(EXCEL_NEW_FILE);
}
The new file is exactly the same as the orginal, no data are refreshed.
If I open the new file with Excel, data are refreshed.
Regards,
Jerome
Hi,
Hi,
My need is :
- The user creates an Excel file with external data connection
- The excel file is refresh on the server. I’ll imagine with Aspose.Cells
- The result file is opened in Aspose.Cells.GridWeb
So if I understand correctly this scenatio is impossible ?
Regards,
Jerome
Hi,
Thank for your answer even if I would have preferred another one
Hi,
Is refreshing external connections (or a subset like SQL) still not on the roadmap? If so, why not? Is there a solid technical reason, or is it simply a strategic/management/marketing decision?
Thank you!
david.
Thanks for considering Aspose APIs.
This is beyond the scope of Aspose.Cells. You must import your data into data table and then import your data table into worksheet.
Please see the following subsection of the article for more help.