Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21189

Conver VBA to VBscript - Environ("Temp") problem

$
0
0
I'm trying to covert some VBA code into VBscript. I borrowed the below code from a working VBA macro. This is not the entire code, but just the part that is giving me issues.

Error Message:
  • Type mismatch 'Environ'


Thanks for any help!

Code:

strtempfile = Environ("TEMP") & Format(Now(), "yyyymmddhhnnss") & ".htm"
Set objrange = objdoc.Range(Start:= 0, End:= 0)
CreateTextFile strtempfile, strBody 
objrange.InsertFile strtempfile, , , False, False
Kill strtempfile


Viewing all articles
Browse latest Browse all 21189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>