View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Robert ap Rhys Robert ap Rhys is offline
external usenet poster
 
Posts: 21
Default Save files to generalized location?


"rach85" wrote in
message ...

Hi there!

Is it possible for the macro to save the files to the temp folder
(found in every pc )?

Private Declare Function GetTempPathA Lib "kernel32" (ByVal nBufferLength As
Long, ByVal lpBuffer As String) As Long

Function GetTempPath() As String
Dim lpBuffer As String
Dim nBufferLength As Long
Dim Ret As Long

nBufferLength = 255
lpBuffer = Space$(nBufferLength)
Ret = GetTempPathA(nBufferLength, lpBuffer)
GetTempPath = Left$(lpBuffer, Ret)

End Function

HTH

Robert