我必须在txt文件中写一个字符串:
Option Explicit
Dim path As String
Dim filename1 As String
path = Application.ActiveWorkbook.Path
filename1 = "OutputHtml.txt"
Open path & "\" & filename1 For Output As #1
Print #1, "<table class="msg">"
但是Print #1, "<table class="msg">"
会在Print #1, "<table class="; msg; ">"
中自动编译,它会显示: msg变量未定义。
如何将正确的字符串打印到filename1?提前致谢