Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7012859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:18:37+00:00 2026-05-27T22:18:37+00:00

I have a document with an invoice number. I want to have a cell

  • 0

I have a document with an invoice number. I want to have a cell value which states the last printed invoice number.

Scenario:

Invoice number is 21. I print the spreadsheet, change the number to 22, save and close.

After this scenario, I want to open the document and read that 21 was the last printed invoice, so that (if I forget to increase the number after printing) I don’t accidentally use the same invoice number (which should be unique).

So, is there a way to add a value to a cell that could read something like “Last printed invoice was 21” after a print command?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:18:38+00:00Added an answer on May 27, 2026 at 10:18 pm

    I am afraid you cannot attach a function after a print has been invoked. Once you send a document to the print queue, it is not controlled by Excel and the application knows nothing about final results (was it printed? was it cancelled? has it jammed?)

    You can add your code to BeforePrint event:

    Private Sub Workbook_BeforePrint(Cancel As Boolean)
    

    And I believe that should do the trick – you can build a logic, where invoice numbers are unique, although you will not be able to guarantee that all numbers are sequential.

    Anyway, for invoicing I would recommend saving/printing/exporting to a PDF file first (with option of overwriting) and printing off the PDF files. It does help for re-prints, e-copies (for an accountant for example) and archiving.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a document file containing HTML markup. I want to assign the contents
I have a document library in MOSS 2007 which has folders and files. Document
I have a document that I want to be flipped / rotated 180 degrees
I've a text field which extends javax.swing.JTextField and also have document listener like this
I have a zip file named test.zip which contains a directory named invoice. Inside
I want to have document.body.innerHTML or document.head.innerHTML I tried the obvious: document.variable.innerHTML but no
We're currently using WPF to create a multi-page invoice document, to then be printed
I have a class, Document and several sub-classes ( Invoice , PurchaseOrder , etc).
I have a query invoice which only updates the total values when a field
I have an application where the user can print a document of selected items

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.