tags:

views:

138

answers:

1

I have an Epson Display Unit (for the Point of Sale), and have it set up as a printer. I can only get it to print what I want when I go to Printer Properties > Fonts (there is a test input box).

However printing from an app such as notepad yields no results. I'm trying to get it to work with the p.o.s. app I made in Excel. I found a COMM port communication script here, but I can't get past the OPEN command. Seems there's a "file in use". I'd like to know if anyone else has had experience with this sort of thing.

+1  A: 

Under the assumption that your printer is connected to serial interface 1, provided that the serial interface parameters are correctly set, and you want to send a string of characters to that interface, you may try this ...

Sub WriteToCOM()
    Open "COM1:" For Output As #1
        Write #1, "ddd"
    Close #1
End Sub

Paste this code into an Excel VBA script and cycle thru it with F8 - it worked for me

You may replace "COM1:" by any existing "COMx:" or "LPTx:" as well (don't forget the semicolon!)

I am using this to control an Amateur Radio (setting the frequency) from an Excel table containing broadcast station names and their frequencies. I am of course sending special characters to my gear using the chr() function.

The Macro is tied to a control button. My Excel is Office 2003 (it worked already in Office97)

Good luck MikeD

MikeD
Thanks Mike! That did the trick - but only after I removed the POS Display Unit from my printer list; apparently that's what was causing the "inaccessible" problem I was having earlier on.
JakeTheSnake