there. i'm trying to pass a file path for defining a new workbook's path... All seems fine until I get a "Subscript out of range" at the line:
Set rngS = Workbooks(wkbS).Range("myRange1")
I've reduced the original file name length, as well as for its folder directory name, etc... I've also switched type definitions between string, variant, etc... I'd appreciate any suggestions. txs a lot.
Sub myMain()
dim wkbS as string
dim rngS as range
wkbS = open_file_src
Debug.Print "w_source_path is : " & wkbS
Set rngS = Workbooks(wkbS).Range("myRange1")
debug.print "Range rngS : " & rngS.address
End Sub
Function open_file_src() As String
strFile_src = Application.GetOpenFilename(filefilter:="Excel files,*.x*", Title:="Select SOURCE file")
Workbooks.Open Filename:=strFile_src
Debug.Print "open_file_src PATH is : " & strFile_src
open_file_src = strFile_src
End Function
