Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 26th, 2007, 11:45 PM
Authorized User
Join Date: Mar 2007
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default Check if a file exists on network

I am trying to check if a file exists within a network before running addition code to create a new (same name) file. If the file exists if will abort the next step

I am running this from vba code.
Notes 1. the file name has no extension
      2. The path is unc based ie(\\myhost\myfolder\file)

Any Help would be appreciated


Old March 27th, 2007, 06:30 AM
Friend of Wrox
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

Set objFSO = CreateObject("Scripting.FileSystemObject")
    If objFSO.FileExists("\\myhost\myfolder\file") Then
    Exit Sub
        'do something here... do you know how to create a file?
End If

Why no extension?

Old March 27th, 2007, 07:15 PM
Authorized User
Join Date: Mar 2007
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts

thanks for that it worked a treat....... the reason for no extension is that the file is to be interfaced into a unix system.

Thanks again for your time


Similar Threads
Thread Thread Starter Forum Replies Last Post
document() - check if a file exists N.Todd XSLT 2 September 19th, 2007 05:50 AM
hei,anyone know how to check a remote file exists lsj113 C# 2005 3 November 28th, 2006 02:55 AM
Check if file starting with a pattern exists or no desperado1306 Excel VBA 1 May 30th, 2006 08:28 AM
check first to see if the file exists crmpicco Classic ASP Professional 2 December 1st, 2005 12:34 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.