Using VBA, how can i edit this code. I have a cell in sheet called "file paths", in that cell is the exact file path of an xlsm file. I am trying to use GetOpenFilename and use that string that is in the file path cell
the file path in that cell is:
C:\Users\ThisPc\Desktop\Book1.xlsm
Code:
Sub Getdata()
Dim CopyFile As Variant
Dim Path As String
Dim Test as Workbook
Application.ScreenUpdating = False
Path = ThisWorkbook.Worksheets("File Paths".Range("D7")).Value
CopyFile = application.getopenfilename(Path)
Am i doing this wrong? Or how is there a way to do this the error happens at the line CopyFile, run time error 1004 method getopenfilename of object _application failed
the file path in that cell is:
C:\Users\ThisPc\Desktop\Book1.xlsm
Code:
Sub Getdata()
Dim CopyFile As Variant
Dim Path As String
Dim Test as Workbook
Application.ScreenUpdating = False
Path = ThisWorkbook.Worksheets("File Paths".Range("D7")).Value
CopyFile = application.getopenfilename(Path)
Am i doing this wrong? Or how is there a way to do this the error happens at the line CopyFile, run time error 1004 method getopenfilename of object _application failed