Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using MS Office 2003 and writing VBA in Excel.
I have a picture which is not inserted in Excel and saves in a folder. I want to know if the picture is opening or not. Because I have to make sure the picture is not opening before renaming it. Do you have any solution to know if the picture is opening? Appreciate for your kind post. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Microsoft has an IsFileOpen function at:
http://support.microsoft.com?kbid=138621 But when I opened some .jpg's in various programs (irfanview, paint, imaging), the file showed not in use. I could even delete it. Could you try to just rename it and then check to see if it was successful: Option Explicit Sub testme() Dim MyOldFileName As String Dim myNewFileName As String MyOldFileName = "c:\my documents\my pictures\keyboard2.jpg" myNewFileName = "c:\my documents\my pictures\keyboard.jpg" If Dir(MyOldFileName) = "" Then MsgBox "It's not there!" Else On Error Resume Next Name MyOldFileName As myNewFileName If Err.Number < 0 Then MsgBox "Rename failed, it may be in use elsewhere" Err.Clear End If End If End Sub Dorothy Lo wrote: I am using MS Office 2003 and writing VBA in Excel. I have a picture which is not inserted in Excel and saves in a folder. I want to know if the picture is opening or not. Because I have to make sure the picture is not opening before renaming it. Do you have any solution to know if the picture is opening? Appreciate for your kind post. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
hyperlink no picture "No program is regitered to open this file" | Setting up and Configuration of Excel | |||
all my shortcuts to excel files open up as a picture | Excel Discussion (Misc queries) | |||
Need to open a picture with a link | Excel Worksheet Functions | |||
Can't open picture file link in Excel, Error no program registere. | Excel Discussion (Misc queries) | |||
open gif with picture and fax viewer from Excel | Excel Discussion (Misc queries) |