a:5:{s:8:"template";s:0:"";s:4:"text";s:3469:"<br>I thought ChDir "..\..\Desktop" would do the trick, but VBA does not like that. Right now the code is: mfdate = FileDateTime("HG Equipment Tracking Matrix.xls") I need to add the UNC pathname to the file name. Behaviour of links in excel is described in this good document. may include the drive. This function can be used in either procedure or function in a VBA editor window in Excel.  You may not post new threads; You may not post replies; You may not post attachments; You may not edit your posts I would like to make the user's Desktop the current directory. Nothing seems to work. Is there an easy way to do this. Looking at an excel cell when document opened via UNC path vs Looking at excel cell when document opened via mapped drive path: =+VLOOKUP(C10,'\\domain.net\folds\USERS\design\bill\[Costings.xls]Sheet1'!GpData,2,FALSE) The path may include the drive. The UNC pathname is: \\beavertn-nas-06\twikle\ What is … Syntax ChDir path The required path argument is a string expression that identifies which directory or folder becomes the new default directory or folder. Parameters or Arguments: The ChDIr function/statement has one argument in Excel VBA. It is a mandatory string type parameter. ChDir statement 12/03/2018 2 minutes to read +1 In this article Changes the current directory or folder. Re: Excel VBA - use UNC path to open Access database. ChDrive/ChDir don't work with UNC paths. Let's look at some Excel CURDIR function examples and explore how to use the CURDIR function in Excel VBA code: CurDir () Result: "C:\Documents and Settings\user\My Documents" CurDir ("G") Result: "G:\" <br> <br>But Ron's suggestion of the API will work with UNC or mapped drives. The folder is located on a server and has a UNC path. It works no matter which computer I run the code from, however I would rather just open my Database using UNC if I can: One particular macro has been giving me trouble, I need it to save multiple workbooks using the UNC path Ex. Here is a work around that I came up with for right now. Description of link management and storage in Excel. Example (as VBA Function) The CURDIR function can only be used in VBA code in Microsoft Excel. its part of a bigger macro but the relevent code is below : Dim filename As String filename = InputBox("Name for new file?") \\server\volume\folder instead of Z: It use to be a code with Chdir to accomplish this, however that is only compatible with a drive letter, and I don't …  Like I said, you don't need to change to a particular drive to open a file from it and most VBA commands can use the UNC path so I can't see where the problem is once you know the share name. Help on the exact syntax can be found by looking 'up the GetOpenFilename method in the VBA help files GetOpenFilenameFrom = Application.GetOpenFilename _ ("Excel Files (*.xl*), *.xl*,All Files (*.*),*. This built-in VBA ChDir statement changes the current or default folder or directory in Excel. Syntax of VBA ChDir Function The syntax of the ChDir Function in VBA is ChDir(Path) The ChDir Function changes the current directory or folder name . I'm trying to save a document to same folder everytime but prompt the user for a file name. Overview of VBA ChDir Function: VBA ChDir function is categorized as File and Directory function. Re: VBA to open Network drive without mappping the drive. where Path: It is a mandatory string type parameter. In VBA I need to open a workbook using the UNC pathname. <br>";s:7:"keyword";s:19:"Excel VBA ChDir unc";s:5:"links";s:979:"<a href="https://saasvaap.com/wp-content/plugins/post-smtp/636p8s.php?tag=69ea55-"></a>,
<a href="https://saasvaap.com/wp-content/plugins/post-smtp/636p8s.php?tag=69ea55-"></a>,
<a href="https://saasvaap.com/wp-content/plugins/post-smtp/636p8s.php?tag=69ea55-"></a>,
<a href="https://saasvaap.com/wp-content/plugins/post-smtp/636p8s.php?tag=69ea55-"></a>,
<a href="https://saasvaap.com/wp-content/plugins/post-smtp/636p8s.php?tag=69ea55-"></a>,
<a href="https://saasvaap.com/wp-content/plugins/post-smtp/636p8s.php?tag=69ea55-"></a>,
<a href="https://saasvaap.com/wp-content/plugins/post-smtp/636p8s.php?tag=69ea55-"></a>,
<a href="https://saasvaap.com/wp-content/plugins/post-smtp/636p8s.php?tag=69ea55-"></a>,
<a href="https://saasvaap.com/wp-content/plugins/post-smtp/636p8s.php?tag=69ea55-"></a>,
<a href="https://saasvaap.com/wp-content/plugins/post-smtp/636p8s.php?tag=69ea55-"></a>,
<a href="https://saasvaap.com/wp-content/plugins/post-smtp/636p8s.php?tag=69ea55-"></a>,
";s:7:"expired";i:-1;}