If this Javascript is creating an excel workbook for you, then you can't add a macro to the workbook by default. You can however do the below, but i'd like to note that this is bad practice and I wouldn't reccomend it. Also noteworthy is that at least one cell has to be selected at all times for each worksheet, so you cant select 'nothing'
You can add an event handler to a personal excel workbook (if you need to create this, follow this guide), which if you have a standard file name for your HTML tables output, then this will select whatever cell you like when you open them in excel:
In ThisWorkbook
of Personal, paste:
Private Sub Workbook_Open()
Set ExcelEvents = New CExcelEvents
End Sub
Then create a new class module (Right Click ThisWorkbook
, > Insert... > Class Module, and paste this code in:
Option Explicit
Private WithEvents XLApp As Application
Private Sub Class_Initialize()
Set XLApp = Application
End Sub
Private Sub XLApp_WorkbookOpen(ByVal Wb As Workbook)
If InStr(1, Wb.Name, "HTMLTableOut", vbTextCompare) > 0 Then Wb.ActiveSheet.Range("A3").Select
End Sub
Replace HTMLTableOut with text that you expect to exist in the filename, that is exclusive to tables exported by this process, and replace A3 with the cell you want to select.
... But that's a hell of a workaround for this.