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

  • 相关阅读:
    Hbase数据库简介
    v8引擎详解
    TCP、UDP和HTTP详解
    关于websocket的代码,实现发送信息和监听信息(前端 后端(node.js))
    浏览器的渲染流程
    事件的各个阶段
    回流和重绘
    Nginx入门教程
    解决浏览器跨域
    TCP三次握手
  • 原文地址:https://www.cnblogs.com/zerotomax/p/6693217.html
Copyright © 2011-2022 走看看