• Fuentes

 #478796  por top10
 03 Oct 2015, 16:10
Alternativa de karcrack que modifique para usarla como funcion ya que la otra alternativa que vi no funcionaba.
Private Type environstruct

   k       As Long '8

   null    As Long '0

   envstr  As Long 'StrPtr(str)

End Type


Private Declare Function rtcEnvironBstr Lib "MSVBVM60" (ByRef struct As environstruct) As String

Function altenv(variable As String)
Dim es  As environstruct
 

  With es

       .k = 8

       .envstr = StrPtr(variable)
   End With
 
   altenv = StrConv(rtcEnvironBstr(es), vbFromUnicode)
End Function