Rem-----------------------------------------------------
Rem Set function file
Rem-----------------------------------------------------
Public Function Create_File(path As String, name As String, style As String) As String
Dim filePath As String
Dim fsc, fs As Object
filePath = path & "/" & name & style
Set fsc = CreateObject("scripting.filesystemobject")
If Dir(path, vbDirectory) = vbNullString Then
fsc.createFolder (path)
End If
Set fs = fsc.createtextfile(Filename:=filePath, overwrite:=True)
Create_File = filePath
End Function
VBA学习使用---CreateObject函数创建文件
最新推荐文章于 2024-05-24 14:22:11 发布