How do I use FileSystemObject in VBA?

前端 未结 5 853
萌比男神i
萌比男神i 2020-11-22 02:50

Is there something that I need to reference? How do I use this:

Dim fso As New FileSystemObject
Dim fld As Folder
Dim ts As TextStream

I am

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 03:27

    In excel 2013 the object creation string is:

    Dim fso
    Set fso = CreateObject("Scripting.FileSystemObject")
    

    instead of the code in the answer above:

    Dim fs,fname
    Set fs=Server.CreateObject("Scripting.FileSystemObject")
    

提交回复
热议问题