Hello,
I'm trying to set up the beginning of this macro to Prompt the user to pick a file which they want the macro to parse thru. Only problem is the string variable that I am storing still has the path connected to it (ie: C:\Temp\Chosen_File). Thus when the rest of the macro is trying to call this string variable, it fails.
Here is my code so far:
Dim rwIndex As Integer
Dim LoadSheet As String
'Checking to see if batch sheet is open, if not allow the user to open it
LoadSheet = Application.GetOpenFilename("Workbooks (*.xls),*.xls", 1, "Please find new batch file to Load"
Workbooks.Open LoadSheet
IsThisWorkbookOpen (LoadSheet)
Windows(LoadSheet).Activate
Both of the calls for Loadsheet fail since the path is still in the string.
What command do I use to just save the filename ONLY in my string variable?
Thanks for your help - I'm a rookie VBA user.
Ed
Kind Regards,
Edward Apacible
International Flavors & Fragrances
Ph: 732-264-4500 Ext. 3469
Fax: 732-335-2350
I'm trying to set up the beginning of this macro to Prompt the user to pick a file which they want the macro to parse thru. Only problem is the string variable that I am storing still has the path connected to it (ie: C:\Temp\Chosen_File). Thus when the rest of the macro is trying to call this string variable, it fails.
Here is my code so far:
Dim rwIndex As Integer
Dim LoadSheet As String
'Checking to see if batch sheet is open, if not allow the user to open it
LoadSheet = Application.GetOpenFilename("Workbooks (*.xls),*.xls", 1, "Please find new batch file to Load"
Workbooks.Open LoadSheet
IsThisWorkbookOpen (LoadSheet)
Windows(LoadSheet).Activate
Both of the calls for Loadsheet fail since the path is still in the string.
What command do I use to just save the filename ONLY in my string variable?
Thanks for your help - I'm a rookie VBA user.
Ed
Kind Regards,
Edward Apacible
International Flavors & Fragrances
Ph: 732-264-4500 Ext. 3469
Fax: 732-335-2350