troubleshooting Question

VBA to Open Cash Drawer via Epson TM-T82

Avatar of kay soo
kay soo asked on
Microsoft AccessVBA
3 Comments1 Solution22 ViewsLast Modified:
Hi Experts,

I try to make a command button to open an Epson TM-T82 connected cash drawer without receipt printing, I hv insalled Epson Virtual Port Driver Utility for the USB-LPT1 interface.

I hv sourced out some codes from the other thread in Expert Exchange and get it to work.

but however the printer still print a tiny print job, is not obvious if the OpenDrawerButton only clicked once, but if clicks for more then 10 times, the wastage of paper is obvious.

based on the following codes, is there anyway or procedures for the printer not to print but just open the drawer?

Private Sub OpenDrawerButton_Click()

    Dim intFileCom As Integer
    Dim strLine As String
    intFileCom = FreeFile
    strLine = Chr(27) & Chr(112) & Chr(0) & Chr(25) & Chr(251)
    ' Open your printer port.
    Open "LPT1" For Output As #intFileCom
    Print #intFileCom, strLine
    Close #intFileCom
End Sub

p/s  from this command line "Print #intFileCom, strLine" , the printer still print about 1mm of blank paper, but the cash drawer opened, I m looking for some code to do away the 1mm printing.  

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros