简体   繁体   中英

How can I use Excel VBA to update links only in a specific worksheet and not the whole workbook?

I have an Excel file where some data from multiple geographies come together. People from one geography don't have access to the sharepoint of other geographies. Each geography has its own worksheet where the data should be updated once a month.

I would like to have a button on each worksheet where once a month someone from each geography updates their worksheet before it is bundled together into one worksheet.

The function .UpdateLinks only works with the whole workbook which is not desirable since the sharepoint access is divided.

I tried to set Excel calculation to manual and afterwards made a button to .Calculate that specific sheet but it seemed to work at first but is not reliable.

ThisWorkbook.Sheets("worksheet1").Calculate '(inconsistent)

ThisWorkbook.Sheets("worksheet1").UpdateLink '(doesn't work)

I would like to have a button to update links only in a specific worksheet and not the whole workbook.

The Workbook.UpdateLink method is located in Workbook and does not exist in Worksheet therefore it is only possible to update the links of the whole workbook but not of single worksheets only.

Updating links in single worksheets only is not supported.

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