zoukankan      html  css  js  c++  java
  • vba打开输入文件

    Sub fileCreate2()

    Dim folderPath, fileName, s As String
    Dim fs, fo, fc, f As Object

    folderPath = "C:Usersofu1Desktopログ"
    Open folderPath & "" & "test02.txt" For Output As #1
    Print #1, "fdsaf"

    Close #1

    End Sub

    '---------------------------------------------------------------------------------

    Sub fileCreate2()

    Dim folderPath, fileName, s As String
    Dim fs, fo, fc, f As Object

    folderPath = "C:Usersofu1Desktopログ"
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set fo = fs.GetFolder(folderPath)

    Set f = fo.createTextFile("test01.txt", True)
    f.WriteLine ("This is a test.")

    f.Close

    End Sub

    '---------------------------------------------------------------------------------
    Sub fileListOpen()

    Dim folderPath, fileName, s As String
    Dim fs, fo, fc, f As Object


    folderPath = "C:Usersofu1DesktopA帳票設計書修正設計書_SRA16_BK"

    Set fs = CreateObject("Scripting.FileSystemObject")
    Set fo = fs.GetFolder(folderPath)
    strFile = InputBox("Enter the full name of the file:")
    Set fc = fo.Files
    For Each f In fc
    'エクセルファイルを開く
    Workbooks.Open f
    With ActiveWorkbook

    End With
    ActiveWorkbook.Close SaveChanges:=True
    Next

    End Sub

  • 相关阅读:
    C# vb .net实现淡出效果特效滤镜
    <<薪资至少10K的一道题,你能拿下吗>>练习
    职场生存规则--水
    简单摸拟电梯程序
    回收期计算
    徒手写汉诺塔
    没有方法的算法代码
    听说是阿里笔试题
    工作任务的分解
    纯吐槽,关于现在的一些混乱情况.
  • 原文地址:https://www.cnblogs.com/zerotomax/p/6693217.html
Copyright © 2011-2022 走看看