Picture file import intermitent problem

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
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,214,932
Messages
6,122,332
Members
449,077
Latest member
jmsotelo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top