Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
check to see a file is existed
Hi Guys,
How Can I : 1- check to see a file (non excel file) is existed? 2- like I do double click on a file (on windows area) to open it with its application, how can I do the same thing with VBA? Thanks in advance |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
check to see a file is existed
To check if a file exists use a function like this:
Function bFileExists(ByVal sFile As String) As Boolean Dim lAttr As Long On Error Resume Next lAttr = GetAttr(sFile) bFileExists = (Err.Number = 0) And ((lAttr And vbDirectory) = 0) On Error GoTo 0 End Function To open a file look at Shell in the VBA help. RBS "2007-User" wrote in message ... Hi Guys, How Can I : 1- check to see a file (non excel file) is existed? 2- like I do double click on a file (on windows area) to open it with its application, how can I do the same thing with VBA? Thanks in advance |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
check to see a file is existed
Thanks,!
"RB Smissaert" wrote in message ... To check if a file exists use a function like this: Function bFileExists(ByVal sFile As String) As Boolean Dim lAttr As Long On Error Resume Next lAttr = GetAttr(sFile) bFileExists = (Err.Number = 0) And ((lAttr And vbDirectory) = 0) On Error GoTo 0 End Function To open a file look at Shell in the VBA help. RBS "2007-User" wrote in message ... Hi Guys, How Can I : 1- check to see a file (non excel file) is existed? 2- like I do double click on a file (on windows area) to open it with its application, how can I do the same thing with VBA? Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to check whither a text is existed | Excel Worksheet Functions | |||
code to check file size everytime an Excel file is opened | Excel Programming | |||
Which function to check any value existed withing a list? | Excel Discussion (Misc queries) | |||
Which function to check any value existed withing a list? | Excel Worksheet Functions | |||
Strange VBA speed issue based on whether overwritten file originally existed or not (?I think?). Excel from Access VBA | Excel Programming |