Open newest file in folder error: cannot be requested

I need an AppleScript to open the newest file in a folder.

When I try this:

set theFolder to choose folder
tell application "Finder"
	set theFile to select last item of (sort files of theFolder by name)
	activate
	open theFile
end tell

This works fine. But when I put the path to the same folder into the script itself, like this:

set theFolder to "Mac HD:Users:bartus:Documents"
tell application "Finder"
	set theFile to select last item of (sort files of theFolder by name)
	activate
	open theFile
end tell

I keep getting this error message:
every file of “Mac HD:Users:bart:Documents” cannot be requested.

I have tried it on a Mac Mini running Mojave and on a MacBook Pro running Monterey. Both say the same thing. Neither does it matter how I sort the folder (creation date, name).
I have given ScriptEditor permission to control the computer in the Accessability pane of the Security Settings.
I have tried exporting the script to an app and run that, to force it to get permission from the automation pane, but it never seems to even get there, it just displays the error message.

How can I get this to work?

Not necessarily, a simple solution is to insert the folder keyword.

And it’s not necessary to select a file to be able to open it nor to activate the Finder

set theFolder to "Mac HD:Users:bartus:Documents"
tell application "Finder"
	open (last item of (sort files of folder theFolder by name))
end tell

However if you use the relative path you get the alias for free

set theFolder to path to documents folder
tell application "Finder"
	open (last item of (sort files of theFolder by name))
end tell

Ah, that is that cleared up then. Nothing to do with permissions. Thanks for your replies, guys. I went with StefanK’s solution. It seemed simplest and it worked.