Having trouble getting macro report variable value

I have a sub where I have the following code:

Dim ProjectPath As String
Dim str_ProjectPath As String
str_ProjectPath = "$(_USTN_PROJECTROOT)"
ProjectPath = ActiveWorkspace.ExpandConfigurationVariable(str_ProjectPath)
Debug.Print str_ProjectPath

What I am trying to do is get the path of the current project but I am getting a path not found error and the debug message just reports $(_USTN_PROJECTROOT). If I use expand echo $(_USTN_PROJECTROOT) within the keyin window I do get the correct path showing in the message centre so I am hoping someone can highlight where I've gone wrong.

Thanks

 

Parents
  • Try either of these...

    Debug.Print "Expanded value of " & _
        "_USTN_PROJECTROOT=" & _
        ActiveWorkspace.ExpandConfigurationVariable ("$(_USTN_PROJECTROOT)")
    Debug.Print "Value of " & _
        "_USTN_PROJECTROOT=" & _
        ActiveWorkspace.ConfigurationVariableValue ("_USTN_PROJECTROOT")

    Note that I've used VBA continuation characters (the underscore) only because long lines of code don't wrap properly on this website.

     
    Regards, Jon Summers
    LA Solutions

Reply
  • Try either of these...

    Debug.Print "Expanded value of " & _
        "_USTN_PROJECTROOT=" & _
        ActiveWorkspace.ExpandConfigurationVariable ("$(_USTN_PROJECTROOT)")
    Debug.Print "Value of " & _
        "_USTN_PROJECTROOT=" & _
        ActiveWorkspace.ConfigurationVariableValue ("_USTN_PROJECTROOT")

    Note that I've used VBA continuation characters (the underscore) only because long lines of code don't wrap properly on this website.

     
    Regards, Jon Summers
    LA Solutions

Children