Hey People,
New question.
I have a verification screen where all the buttons pressed-information is stored in text-boxes.
Once pressed the "save to database" button, he's looking up on a server in a folder if a particular excel file with current year and week-number exist.
2 options:
No problems with that.
The problem is because of the wireless internet connection searching does take a bit longer.
So i'm adding a Picturebox with a gif image that would show a please wait animation.
I call the gif animation to hide when the verification screen opens.
I call the gif animation to show when the "save to database" button is pressed.
So it hangs when looking on the server for the file-search.
I thought, let me introduce a timer with 2 sec before looking on the server and see how that works out. Unfortunately when the 2 seconds are out and the code starts, the gif file stops again untill the code stops.
Any help?
This is the code:
New question.
I have a verification screen where all the buttons pressed-information is stored in text-boxes.
Once pressed the "save to database" button, he's looking up on a server in a folder if a particular excel file with current year and week-number exist.
2 options:
- The file exist: write the information from the textboxes in the last row of the existing excel file.
- The file doesn't exist: create a file and add information from textboxes to the first free line available.
No problems with that.
The problem is because of the wireless internet connection searching does take a bit longer.
So i'm adding a Picturebox with a gif image that would show a please wait animation.
I call the gif animation to hide when the verification screen opens.
I call the gif animation to show when the "save to database" button is pressed.
So it hangs when looking on the server for the file-search.
I thought, let me introduce a timer with 2 sec before looking on the server and see how that works out. Unfortunately when the 2 seconds are out and the code starts, the gif file stops again untill the code stops.
Any help?
This is the code:
VB.NET:
Public Class VerificationScreen
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
PictureBox1.Show()
Timer1.Interval = 2000 'sets the timer's tick interval to 2 sec
Timer1.Enabled = True 'the timer is disabled on form load so you have to enable it
End Sub
Private Sub Timer1_tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Timer1.Enabled = False
Dim TargetWorkbook As Excel.Workbook = Nothing
Dim SourceWorkbook As Excel.Workbook = Nothing
Dim Target_Path As String
Dim strFile As String
strFile = TextBox6.Text
If Len(strFile) = 0 Then Exit Sub
'''''Assign the Workbook File Name along with its Path
'''''Change path of the Target File name
Target_Path = "S:\Quality\~SIPSTATION~\BACKUP FILES\PC1\" & Date.Today.Year & strFile & ".xlsx"
If Len(Dir(Target_Path)) = 0 Then
MsgBox("File does not exist, creating new file...")
Call NewWb()
Else
Call AdjustWb()
End If
End Sub
Last edited: