(Solved) – Unable to run vbscript file due to access limit

  • by
(solved)-–-unable-to-run-vbscript-file-due-to-access-limit

I am trying to upload a file on HTML page, for which I need to run the vbascript saved on my desktop. But when I am executing the code its asking for admin permission and getting error as “Access Denied”. So is there any way to run this file without but it should not break any policy and as I don’t want to create any security issue.

Thanks in advance:)

Sub uploadFiles()

Dim ie As Object
Dim strFile As Variant
Dim strUploadFile As Variant
Dim objShell As Variant


 Set ie = CreateObject("InternetExplorer.Application")
 ie.navigate "https://www.pdftoexcelconverter.net/"
 ie.Visible = True

Application.Wait DateAdd("s", 5, Now)
strFile = "C:UserskiranmDesktop2019FileUpload.vbs"  
strUploadFile = "C:UserskiranmDesktop2019fl0005.pdf" 

Dim R_Shl As Double


Set objShell = CreateObject("WScript.Shell")
   objShell.Run Chr(34) & strFile & Chr(34) & strUploadFile & Chr(34)


ie.document.getElementsByName("Filedata")(0).Click
Application.Wait DateAdd("s", 2, Now)


End Sub

Leave a Reply

Your email address will not be published. Required fields are marked *