Results 1 to 3 of 3

Accessing the windows drive from vba.....

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-16-2011
    Location
    London
    MS-Off Ver
    Excel XP
    Posts
    276

    Accessing the windows drive from vba.....

    I'm using the following code to create a folder in docs & settings and put a data file there:

    
    Workbooks.Add
        Path = "C:\documents and settings\all users\application data\WAIL"
            
        On Error Resume Next
             GetAttr (Path)
             If Err.Number <> 0 Then
                MkDir Path
             End If
             On Error GoTo 0
             Path = Path + "\WAILdb.xls"
        
        
        Application.DisplayAlerts = False
        ActiveWorkbook.SaveAs Filename:=Path, FileFormat:=xlNormal, Password:="ItsASecret", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False
    However, if a user has a windows installation that isn't located on C: (rare but it happens) is there a way to ensure access to the correct location?
    Last edited by swoop99; 03-03-2012 at 04:29 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1