ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get file reference using File System Object (https://www.excelbanter.com/excel-programming/421489-get-file-reference-using-file-system-object.html)

XP

Get file reference using File System Object
 
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


Gary''s Student

Get file reference using File System Object
 
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


XP

Get file reference using File System Object
 
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


Gary''s Student

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



All times are GMT +1. The time now is 01:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com