View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Get file reference using File System Object

First include a reference to Microsoft Scripting Runtime and then:

Sub xp()
Dim FSO As Scripting.FileSystemObject
Dim FileItem As Scripting.File
Set FSO = New Scripting.FileSystemObject
Set FileItem = FSO.Getfile("C:\test\A.ppt")
MsgBox (FileItem.Path)
MsgBox (FileItem.Size)
MsgBox (FileItem.Type)
MsgBox (FileItem.DateCreated)
Set FileItem = Nothing
Set FSO = Nothing
End Sub

If the POLICE allow, checkout:
http://msdn.microsoft.com/en-us/library/d6dw7aeh.aspx
or
http://msdn.microsoft.com/en-us/libr...t8(VS.85).aspx
--
Gary''s Student - gsnu200821


"XP" wrote:

Hi,

Thanks; unfortunately our internet Nazi's have that site blocked;
is there a chance you could point me to another site or perhaps
just throw me a bone with the next line of code I need...?

Thanks so much!

"Gary''s Student" wrote:

see Bob Phillips's post:

http://groups.google.com/group/micro...o&rnum=1&hl=en
--
Gary''s Student - gsnu200821


"XP" wrote:

Hi,

I need to get a reference to a text file using the file system object; here
is what I have far:

Dim oFSO As Object
Dim oFile As Object
Set oFSO = CreateObject("Scripting.FileSystemObject")


Can someone please help me out with this and post what I still need using a
generic file path/filename?

Thanks