Open a file with notepad through VBA

前端 未结 5 627
一向
一向 2020-12-19 23:39

I am trying to open a file with notepad.

const strfilename = \"C:\\Users\\Desktop\\abc.txt\"

set OFS = myOFSO.OpenTextFile(strfilename) 

I

5条回答
  •  清酒与你
    2020-12-20 00:34

    Below code will help you to open notepad from excel.

    Dim fso As Object
    Dim sfile As String
    Set fso = CreateObject("shell.application")
    sfile = "C:\Users\Universal\Desktop\test.txt"
    fso.Open (sfile)
    

提交回复
热议问题