Welcome to Golden Software Support

Inserting the "DateString" into file name

Comments

1 comment

  • Avatar
    Leslie McWhirter

    Hello Sayce,

    You will need to define a string from the worksheet column containing your date/time value, and then you can use the Format command to format it in the desired yyyyMMdd format. Katie sent you instructions for how to do this back in December. I've copied her code here, replacing the date/time format she defined with your yyyyMMdd format.

     

     Dim Wks As Object
        Dim dateFromWks As Date
        Set Wks = SurferApp.Documents.Open("C:\Temp\demogrid_dates.xls")
        Dim WksRange As Object
        Set WksRange = Wks.Cells("C2")
        dateFromWks = WksRange.Value
        DateString = Format(dateFromWks, "yyyyMMdd")

        Wks.Close

        Dim Plot As Object
        Set Plot = SurferApp.Documents.Add
        Set Text1 = Plot.Shapes.AddText(x:=2.00, y:=11.15, Text:="Collie River - Physical-chemical Profile "+ Str(DateString))

     

    Thanks,

    Leslie

    0
    Comment actions Permalink

Please sign in to leave a comment.