简体   繁体   中英

Refreshing excel file vb.net

I have a form created in visual studio 2013 which populates data from form to excel sheet. The sheet is opened when user enters data in the form. What I want is that when user enters data in form and it populates to excel sheet, the file should get refreshed so that everyone can see that. The file is in shared mode.

I tried

xlworkbook.refreshall() 'xlworkbook is my excel workbook

But it throws an error:

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in Quote.exe

Additional information: Exception from HRESULT: 0x800A03EC

How do I solve this? Please help!

I did not understand if the file is opened on the screen or not, but if you want to see the changes to all you need to save the file.

Then you must use the "Save" method and not "RefreshAll"

When you share an Excel file, under advanced options, there is the 'Update changes to save the file', check it if the flag is checked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM