配送ラベルを印刷するコードを Zebra s600 プリンターに継承しました。このコードは Windows XP では正常に動作しますが、Windows 7 では動作しない理由がわかりません。
Windows 7 でプログラムを実行すると、「実行時エラー '75' パス/ファイル アクセス エラー」というエラーが表示されます。
しかし、WindowsXP で動作するので、パスは間違っていません。
編集:右クリックしてプログラムを管理者として実行するとともに、比較モードで実行してみました。それでもうまくいきません。
Sub PrintLabel()
'**** this sub print a barcode label on the Zebra S600 printer
'**** for the cardboard shipping box.
Dim mySNprinter As String
mySNprinter = GetSetupVariable("TestSnPrinter")
If (mySNprinter = "") Then
mySNprinter = "\\dc1\bertha"
End If
Open mySNprinter For Output As #3
Print #3, "^XA" 'start of data
Print #3, "^LH20,25" 'home position of label is 5,25
If optSize(0).Value = True Then
Print #3, "^FO1,30^A0,N,25,25^FD" & cboLabel.Text & "^FS" 'print MP-1 with the D font
End If
If optSize(1).Value = True Then
Print #3, "^FO1,30^A0,N,35,35^FD" & cboLabel.Text & "^FS" 'print MP-1 with the D font
End If
If optSize(2).Value = True Then
Print #3, "^FO1,30^A0,N,50,50^FD" & cboLabel.Text & "^FS" 'print MP-1 with the D font
End If
Print #3, "^XZ" 'end data
Close #3