Hello,
I am using the following subroutine and recently I have received a run time error stating type mismatch in regards to the line: Sep = Chr(9). I never had an issue with that line in the past. Any ideas?
Sub DoTheImport()
Dim shtName As String
Dim Chr
shtName = "Product " & CStr(ProdNum)
Dim Prod As Variant
Dim Sep As String
Application.ScreenUpdating = False
'Activate data sheet
Worksheets(shtName).Activate
Worksheets(shtName).Cells(1, 1).Activate
'Ask for file
Prod = Application.GetOpenFilename(FileFilter:="Input Files (*.csv),*csv")
'If no file selected, end macro
If Prod = False Then
Exit Sub
End If
Sep = Chr(9)
ImportProduct FName:=CStr(Prod), Sep:=Sep
End Sub
I am using the following subroutine and recently I have received a run time error stating type mismatch in regards to the line: Sep = Chr(9). I never had an issue with that line in the past. Any ideas?
Sub DoTheImport()
Dim shtName As String
Dim Chr
shtName = "Product " & CStr(ProdNum)
Dim Prod As Variant
Dim Sep As String
Application.ScreenUpdating = False
'Activate data sheet
Worksheets(shtName).Activate
Worksheets(shtName).Cells(1, 1).Activate
'Ask for file
Prod = Application.GetOpenFilename(FileFilter:="Input Files (*.csv),*csv")
'If no file selected, end macro
If Prod = False Then
Exit Sub
End If
Sep = Chr(9)
ImportProduct FName:=CStr(Prod), Sep:=Sep
End Sub