How to get name of the computer in VBA?
Dim sHostName As String ‘ Get Host Name / Get Computer Name sHostName = Environ$(“computername”)
Dim sHostName As String ‘ Get Host Name / Get Computer Name sHostName = Environ$(“computername”)
You can do it with IE ‘sometimes’ as I have done this for an internal application on an intranet which is IE only. Try the following: function GetComputerName() { try { var network = new ActiveXObject(‘WScript.Network’); // Show a pop up if it works alert(network.computerName); } catch (e) { } } It may or may … Read more