Hello ppl
i have this script that loads images in the directory but everytime it gives me an error of sharing violation. I attatched an excel file so you can see for yourself.
I found a solution for this by renaming the file using saveas an then quit, not the correct one i guess but it worked:
final = picpath & final & "_final.xlsm"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=final
Application.DisplayAlerts = True
Application.Quit
My question is when i tryied to changed a bit and
1) i tryied to "kill the original file" it gives me an error "file allready open"
final = thisworkbook.name
inicial = picpath & thisworkbook.name
final = picpath & final & "_final.xlsm"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=final
ActiveWorkbook.Save
Kill inicial
Application.DisplayAlerts = True
Application.Quit
2) i tryied to save as final, then original and erase the final it doesn not give me an error but neither saves the images ....
final = thisworkbook.name
inicial = picpath & thisworkbook.name
final = picpath & final & "_final.xlsm"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=final
ActiveWorkbook.Save
Application.DisplayAlerts = True
ActiveWorkbook.SaveAs Filename:=inicial
Kill final
ActiveWorkbook.Save
How can i resolve this? how can one saveas 2 times and save the images?
or am i thinking wrong? is there any other way ?
by the way i attatched a piece of the file so that you can see for yourself . .
Thanx in advanced
Bookmarks