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

  • 相关阅读:
    css
    常见属性
    表单
    html的块
    常见标签(一)
    html5 文本内容
    整数的分解
    快速排序及其应用
    javascript之动画特效
    html标签积累
  • 原文地址:https://www.cnblogs.com/zerotomax/p/6693217.html
Copyright © 2011-2022 走看看