P
Petr
Hallo,
I have the problem with numeric input via inputbox used in file path.
E.g.
… \Rok 2004 (GFS 1986 data)\SR\SR 2004 Q data.xls (numeric parameter
in this sample is "2004", respectively).
These are my 2 routines (for second I tried the workaround posted in
groups), but neither of them is working.
Thanks a lot in advance for any suggestions.
Best regards, Petr Duzbaba
Sub test_mismatch_error1()
Dim SegmInput As String
Dim YearInput As Integer
Application.ScreenUpdating = False
Do:
SegmInput = InputBox("Submit the correct abbreviation (SR)!")
If Not SegmInput = "SR" Then
MsgBox "Invalid input (must be SR)!", vbCritical
End If
Loop Until SegmInput = "SR"
segment_dbvr = SegmInput
Do:
YearInput = InputBox("Submit year!")
If Not YearInput = 2004 Then
MsgBox " Invalid input (must be 2004)!", vbCritical
End If
Loop Until YearInput = 2004
year_dbvr = YearInput
Workbooks.Open Filename:= _
"C:\Dokumenty\Prace\Verejne rozpocty\Ostatni VR\DB VR\Ctvrtletni
data\Rok " & year_dbvr & " (GFS 1986 data)" \ " & segment_dbvr & " \
segment_dbvr & " " & year_dbvr & " Q data.xls"""
End Sub
Sub test_mismatch_error2()
Dim segment_dbvr As String
Application.ScreenUpdating = False
Do:
SegmInput = Application.InputBox("Submit correct abbrev. (SR)")
If Not SegmInput = "SR" Then
MsgBox "Invalid input (must be SR)!", vbCritical
End If
Loop Until SegmInput = "SR"
Dim year_dbvr As Integer
Dim year_dbvr_aux As String
year_dbvr_aux = InputBox("Submit year:", "Year input")
If IsNumeric(year_dbvr_aux) Then
year_dbvr = year_dbvr_aux
Workbooks.Open Filename:= _
"C:\Dokumenty\Prace\Verejne rozpocty\Ostatni VR\DB VR\Ctvrtletni
data\Rok " & year_dbvr & " (GFS 1986 data)" \ " & segment_dbvr & " \
segment_dbvr & " " & year_dbvr & " Q data.xls"""
Else
End If
End Sub
I have the problem with numeric input via inputbox used in file path.
E.g.
… \Rok 2004 (GFS 1986 data)\SR\SR 2004 Q data.xls (numeric parameter
in this sample is "2004", respectively).
These are my 2 routines (for second I tried the workaround posted in
groups), but neither of them is working.
Thanks a lot in advance for any suggestions.
Best regards, Petr Duzbaba
Sub test_mismatch_error1()
Dim SegmInput As String
Dim YearInput As Integer
Application.ScreenUpdating = False
Do:
SegmInput = InputBox("Submit the correct abbreviation (SR)!")
If Not SegmInput = "SR" Then
MsgBox "Invalid input (must be SR)!", vbCritical
End If
Loop Until SegmInput = "SR"
segment_dbvr = SegmInput
Do:
YearInput = InputBox("Submit year!")
If Not YearInput = 2004 Then
MsgBox " Invalid input (must be 2004)!", vbCritical
End If
Loop Until YearInput = 2004
year_dbvr = YearInput
Workbooks.Open Filename:= _
"C:\Dokumenty\Prace\Verejne rozpocty\Ostatni VR\DB VR\Ctvrtletni
data\Rok " & year_dbvr & " (GFS 1986 data)" \ " & segment_dbvr & " \
segment_dbvr & " " & year_dbvr & " Q data.xls"""
End Sub
Sub test_mismatch_error2()
Dim segment_dbvr As String
Application.ScreenUpdating = False
Do:
SegmInput = Application.InputBox("Submit correct abbrev. (SR)")
If Not SegmInput = "SR" Then
MsgBox "Invalid input (must be SR)!", vbCritical
End If
Loop Until SegmInput = "SR"
Dim year_dbvr As Integer
Dim year_dbvr_aux As String
year_dbvr_aux = InputBox("Submit year:", "Year input")
If IsNumeric(year_dbvr_aux) Then
year_dbvr = year_dbvr_aux
Workbooks.Open Filename:= _
"C:\Dokumenty\Prace\Verejne rozpocty\Ostatni VR\DB VR\Ctvrtletni
data\Rok " & year_dbvr & " (GFS 1986 data)" \ " & segment_dbvr & " \
segment_dbvr & " " & year_dbvr & " Q data.xls"""
Else
End If
End Sub