A
Reaction score
0

Profile posts Latest activity Postings About

  • Part 2

    90 DirName = strNewReportPath
    100 If Dir(DirName, vbDirectory) = "" Then
    110 If MsgBox("Is it OK to create a new folder in X:\Drilling\Regulatory\Regulatory Database Reports\" & UserLogin & "\GISLatLong Report? (recommended yes)", vbOKCancel) = vbOK Then
    120 DirName = UserPath
    130 MkDir DirName
    140 Err.Clear
    150 Call LogUsage("GISLatLong Report", "cmdAPDExcelReports", "line MkDir")
    160 Else
    170 MsgBox "Create new folder cancelled. Folder not created.", vbOKOnly, "Report Cancelled, must allow folder to be created"
    180 Exit Function
    190 End If
    200 Else
    'MsgBox "The folder already exists..." & Chr(10) & "Please check the directories using Windows Explorer.", vbOKOnly
    ' if it exist, don't bother letting the user know
    220 End If

    If you are newly registered, I encourage you to give anyone who helps you a "thanks". You will find that in general, they will be willing to help more often.

    Happy Holidays
    Our group has a Shared Folder (mapped to X: ) so that all uers can save reports. This is some code that I use to create a folder name for each user - then a folder for the name of the report.
    This way, each of the many users running dozens of reports have a folder that is organized.
    Keep the path name in a variable. When you are ready to output the PDF file - use the path that was created.


    30 On Error GoTo PROC_ERROR
    ' Mapped Network path for My Documents (not on C:\ drive) with user login then a subdirectory for "GISLatLong ReportReport"
    50 UserLogin = Environ("username")
    ' user requested changes 2/2/2011 change report name and folder name
    60 UserPath = "X:\Drilling\Regulatory\Regulatory Database Reports\" & UserLogin & "\GISLatLong Report" '"
    70 strNewReportPath = UserPath
    'Debug.Print "UserLogin " & UserLogin & " StringNetwork path " & strNewReportPath
    80 Call LogUsage("GISLatLong Report", "UserLogin path", strNewReportPath)
  • Loading…
  • Loading…
  • Loading…
Top Bottom