-1

First off, I am new to this all. I have a macro which will open all of the hyperlinks I have in an excel file, but I would like to automate the process in microsoft flow/power automate. I am not sure how to convert this to where it will work in office scripts. Any help would be appreciated.

Sub BatchOpenHyperLinks_Workbook()
Dim objWorksheet As Excel.Worksheet
Dim objSelectedRange As Excel.Range
Dim objHyperlink As Excel.Hyperlink

'Process each worksheet
For Each objWorksheet In ThisWorkbook.Sheets
For Each objHyperlink In objWorksheet.Hyperlinks
objHyperlink.Follow
Next
Next
End Sub
Yutao Huang
  • 1,503
  • 1
  • 13
  • 25

1 Answers1

1

Yes, this VBA code can be converted in to Office Scripts code. But the objHyperlink.Follow won't work. In this example, below, you can see how Excel Online uses URI's/URL's. It fetched the data at those links. It doesn't open a new web page in your browser it fetches data instead.

function main(workbook: ExcelScript.Workbook) {
  const uri = 
  'https://jsonplaceholder.typicode.com/posts/1';
  const result = await fetch(uri);
  const json = result.json();
  console.log(json);
}
Les Black
  • 51
  • 2