Dim aa As String
  
  aa = "哈哈"
  Open App.Path & "\ " & aa & " .txt" For Input As #1
    
    ........
    
    
  Close #1这样做为什么说"找不到文件呢?"

解决方案 »

  1.   

    在input 读入文件前先检测一下文件是否存在,if dir(filepath)<>"" then
    input 读入文件时 文件必须存在
      

  2.   

    aa = "哈哈"
      Open App.Path & "\ " & aa & " .txt" For Input As #1
    --------------------------------------------------你的当前目录下必须存在  哈哈.txt 文本文件才行
      

  3.   

    你的工程保存了没有?用上面的语句的话,你的 哈哈.txt 文件必须放在工程所在的文件夹下才不会出错
      

  4.   

    Open App.Path & "\ " & aa & " .txt" For Input As #1原因我终于发现了,原来是" .之间好像多了个空格,
    唉,这种错误实在是难找啊