1

I am fairly new to vba. Appologies if this is a simple question, but after 3 days on google im starting to feel dumb.

I am writing a very simple POS program to take stock in a bar. Part of the program is a Till point function. I am writing in excel VBA. I have a generic pos printer connected to a generic cash drawer. Printer is connected via usb to pc.

My question: i am unable to get the cash drawer to kick open when a receipt is printed. It is printing the reciepts fine, but i do not how how to send a ascii - esc/pos command to the printer.

I know that i should use "chr(27), chr(112)" , but how?!

As a last resort Ive tried pasting those chars in a cell and used cells("A1").printout function but that just sends it to the printer as text to be printed and not a command.

Any help would be greatly appreciated.

Marchant

4

1 回答 1

1

该链接建议:

Option Explicit
Sub testme01()
Open "LPT1:" For Output As #1
Print #1, chr(27)+chr(112)
Close #1
End Sub
于 2013-02-01T16:34:42.480 回答