mtheriault2000
Well-known Member
- Joined
- Oct 23, 2008
- Messages
- 826
Hello
I have a routine that take a screen capture with Hypersnap.
-After the capture is done, a new file is created.
- I give a delay of 1250 ms to complete
- Then another routine look in the directory to scan for the last file created.
My problem is intermitently, the program failed at the last line of this routine.
<< ActiveSheet.Pictures.Insert(RANGE("SonrayPicture_Path") & RANGE("Fname_")).Select >>
N.B. If i leave the MsgBox debug line on, then no problem.
I have no clue at all how to prevent it to append
Martin
Sub Ajustement_Dessin_2()
Call Open_hypersnap ' take a snap picture
Sleep 1250
Application.ScreenUpdating = False
'Dim TP As Single
Dim Zoom_ As Long
Zoom_ = ActiveWindow.Zoom
ActiveWindow.Zoom = 100
Call LastUpdatedFile ' Look for the last updated file
ActiveSheet.Unprotect
Sheets("Sat_Sheet").Select
RANGE("graphique_PL").Select
'MsgBox (RANGE("SonrayPicture_Path") & Fname) ' Debug line
ActiveSheet.Pictures.Insert(RANGE("SonrayPicture_Path") & RANGE("Fname_")).Select
I have a routine that take a screen capture with Hypersnap.
-After the capture is done, a new file is created.
- I give a delay of 1250 ms to complete
- Then another routine look in the directory to scan for the last file created.
My problem is intermitently, the program failed at the last line of this routine.
<< ActiveSheet.Pictures.Insert(RANGE("SonrayPicture_Path") & RANGE("Fname_")).Select >>
N.B. If i leave the MsgBox debug line on, then no problem.
I have no clue at all how to prevent it to append
Martin
Sub Ajustement_Dessin_2()
Call Open_hypersnap ' take a snap picture
Sleep 1250
Application.ScreenUpdating = False
'Dim TP As Single
Dim Zoom_ As Long
Zoom_ = ActiveWindow.Zoom
ActiveWindow.Zoom = 100
Call LastUpdatedFile ' Look for the last updated file
ActiveSheet.Unprotect
Sheets("Sat_Sheet").Select
RANGE("graphique_PL").Select
'MsgBox (RANGE("SonrayPicture_Path") & Fname) ' Debug line
ActiveSheet.Pictures.Insert(RANGE("SonrayPicture_Path") & RANGE("Fname_")).Select