PDA

View Full Version : Open external file as administrator



Emoncada
03-29-2012, 10:31 AM
I have the following script that works fine on XP, but having issues running it in Windows 7. I believe it's because it's not opening the .lab file as an administrator, since I right click .lab file and run as administrator it opens without a problem.

Sub FetchFile_Click()

On Error GoTo NoFile
strAddress = "C:\Incoming grabber.lab"
ActiveWorkbook.FollowHyperlink Address:=strAddress
Exit Sub

NoFile:
MsgBox "Sorry. File is not available at this time", vbInformation, "Error!"

End Sub