Suppress excel 'update links' warning- via script
When we open a workbook which contains links or references, we will get the following warnings.
Warning 1:
To suppress,
- Go to File > Options, in the excel options dialog box, click advanced in the left pane, and then uncheck 'ask to update automatic links' under the general section, see screenshot:
Warning 2:
To suppress,
1. Click Data > Edit Links,
2. In the Edit Links dialog box, click 'Startup Prompt' button at the bottom,
3. And then in the prompt, choose 'Don’t display the alert and don’t update automatic links'.
===================================================================================
We can achieve the same via script. (please refer to the attached .txt file)
Method parameters,
- path - excel file path
- workSheet - sheet number
public void hideLink(string path, int workSheet)
* Make sure to set, StartOnProjectStart = false on excel.
Note: Add this line before the namespace, using myExcel = Microsoft.Office.Interop.Excel;