[VBA ] Excel開啟新檔案
請問一下以下的程式碼是否哪裡出了問題,我在其他台電腦都可以用,
可是一回到家用自己的電腦發現程式就不能跑了,原因在於找不到檔案。
從區域變數視窗中可以看到,我的dfile1跟dfile2都有找到檔案並且開
啟,但是當我想利用dfile2的名字製造一個新檔案時,卻跟我說找不到檔案,
但是我在其他台電腦都可以用,只有自己家裡的電腦不能跑,請問一下是啥
緣故,謝謝。
我的部分程式碼如下:
dfile1 = Dir(DataPath1, vbNormal) 'get filename of the 1st file
dfile2 = Dir() 'get filename of the 2nd file
Open DataPath1 & dfile1 For Input As #1 'open file
Open DataPath1 & dfile2 For Input As #2 'open file
If dfile1 <> "" And dfile2 <> "" Then
Open DataPath1 & "dvt" & dfile2 For Output As #3
End If
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.216.187.73
推
10/16 11:09, , 1F
10/16 11:09, 1F
→
10/16 11:11, , 2F
10/16 11:11, 2F
→
10/17 00:42, , 3F
10/17 00:42, 3F
→
10/17 00:42, , 4F
10/17 00:42, 4F
→
10/17 00:43, , 5F
10/17 00:43, 5F
→
10/17 00:44, , 6F
10/17 00:44, 6F
推
10/17 09:30, , 7F
10/17 09:30, 7F
推
10/17 09:35, , 8F
10/17 09:35, 8F
→
10/17 09:37, , 9F
10/17 09:37, 9F
→
10/17 23:53, , 10F
10/17 23:53, 10F
→
10/17 23:54, , 11F
10/17 23:54, 11F
Visual_Basic 近期熱門文章
PTT數位生活區 即時熱門文章