Set visible of process - Catalina & Excel 2019 v16.33

Having upgraded to Catalina and switching to Excel 2019 v16.33 it seems that “set visible of process” is no longer working within this script. Previously on Mojave using Excel 2011 there was no issue and process remained hidden. Any insight on what is issue might be would be greatly appreciated!

on run
set choosefiles to choose file with prompt “Please select some images to process:” of type {} with multiple selections allowed
tell application “System Events”
set visible of process “Microsoft Excel” to false
end tell
tell application “Microsoft Excel”
repeat with aFile in choosefiles
open aFile
tell active workbook
run VB macro “PERSONAL.XLSB!Macro1”
end tell
set wkbk_name to get full name of active workbook
set newfilename to ((characters 1 thru -5 of wkbk_name) as string) & “.xlsx”
save workbook as active workbook filename newfilename file format Excel XML file format
close active window
end repeat
end tell
return choosefiles
end run

One possibility is that it’s done for reasons of security. Stuff happening out of the user’s sight isn’t exactly in favor security-wise these days. Just speculating…

Thanks ShaneStanely, I suspect you are correct.
Under my new Security & Privacy settings I feel I’ve granted all the proper access the apps needed under the Automation settings, plus under Full Disk Access I’ve tested adding Script Editor, Automater, Fast Scripts, Finder, the actual AppleScriptEngine library…I even went as far as adding System Events to full disk access (as redundant as that sounds) but the Excel process still will not hide. Officially out of ideas.

If you’re hiding Excel because you need to speed up the script execution, you can use the Excel screen updating property.

-- you can restrict the file types to images only (including pdf)
set choosefiles to choose file with prompt "Please select some images to process:" of type {"public.image", "com.adobe.pdf"} with multiple selections allowed

tell application "Microsoft Excel"
	-- here is the workaround:
	set screen updating to false
	
	repeat with aFile in choosefiles
		open aFile
		tell active workbook
			run VB macro "PERSONAL.XLSB!Macro1"
		end tell
		set wkbk_name to full name of active workbook
		set newfilename to (my getFileName:wkbk_name)
		save workbook as active workbook filename newfilename file format Excel XML file format
		close active workbook saving no -- this will garanty all windows for the document are closed
	end repeat
	-- restore the normal behavior
	set screen updating to true 
end tell

-- this handler will safely delete the extension, without knowing its length
on getFileName:theFile
	set oldDelims to AppleScript's text item delimiters
	set AppleScript's text item delimiters to {"."}
	set theName to text item 1 of theFile
	set AppleScript's text item delimiters to oldDelims
	return theName
end getFileName:

Hi Jonas, thank you so much for the reply and for the script edits!

You are correct, my intention is to hide Excel to help speed up the script execution.
I’ve tested the “set screen updating to false” but unfortunately the same issue persists. Each Excel file visibly opens, the macro applies and the window saves and closes, all in the foreground. I really do appreciate the workaround suggestion, it just seems Excel will not function in the background like it used to. Which is a big bummer.