How to ignore vba excel error runtime error '1004'



How to ignore vba error runtime error 1004

Question-when not select file then show below runtime error
below image
below copy code and paste modules
----------------------------------------------------------------------------------------------
Sub browsefileopen()

' step 1 below code for ignore runtime error
On Error Resume Next
'below browse file code
myfile = Application.GetOpenFilename(, , "Browse for File")

'browse filename update with file location in active sheet.
ThisWorkbook.Sheets("sheet1").Range("a2") = myfile


'select browse  file open code

Workbooks.Open myfile
' step 2 below code for ignore runtime error
On Error GoTo 0


End Sub
---------------------------------------------------------------------------

About Me

author Click here for Connect FB

Click here for Linkedin

Related Post No.

Powered by Blogger.

Contact Form

Name

Email *

Message *

Search This Blog

Recent Posts

Breaking

Popular Posts

Recent Posts

Trending Topic

Breaking

Related Post No.

Pages