Can anybody stop this happening please

P

Pammi J

Hi
i have a excel invoice - In cell H15 is a invoice number which is stored in
another exel workbook - and each time my invoice template is opened it
increments by 1.
Could anyone please explain simply and easy to understand terms - how i save
a copy of the invoice (after filling it out) - and be able to open it to ie
edit or veiw (the copy) without the invoice number on the copy adding one and
throwing out my invoicing number system.
Here is what i have - and im on excel 2000
IN THE WORKBOOK CODE
Private Sub Workbook_Open()
Application.ScreenUpdating = False
Workbooks.Open Filename:="C:\Documents and Settings\Pam\My
Documents\Invoice\InvoiceNumber.xls"
ActiveWorkbook.Save
ActiveWorkbook.Close
Application.ScreenUpdating = True
End Sub

IN the invoice template - cell H15 is a path to the InvoiceNumber.xls -

Can someone please tell me what i should do - iv checked links on the
answers page to websites - but they a bit hard to disypher and pick around.

many thanks
 
G

Gary''s Student

Open the workbook in Office Safe Mode. The Event macro will not run and the
invoice number will not increment.
 
M

Mike Rogers

Pammi J

This is an extreme way and if you have a lot of invoices it may be to time
consuming, but you could delete the sub routine that increments the invoice
numbers from saved worksheet. Or maybe one of those that speak VBA could
alter the routine to check if there is a number in H15, and if so "do
nothing". Just a thought!

Mike Rogers
 
P

Pammi J

Hi "Gary"s Student"
that sounds good, but how do i do that? i have investigated security on the
macros but it seems i can only disable securtiy on every workbook - no just
the copys i save. Unless im looking in the wrong info, and its nothing to do
with the security. Could you explain please
thankyou
Pam
 
G

Gary''s Student

1. leave your security setting alone.
2. hold down the CNTRL key and, while holding it, start Excel
3. confirm to Excel that you want Safe mode
4. open your file from that instance of Excel
5. Excel will complain about the macros, but will open the workbook with
macros disabled

Because macros have been disabled, the invoice number in H15 will not
increment.

This is only a temporary situation. The next time you use Excel, it will
behave normally..

Safe Mode is a good way to open a workbook without unwanted events occurring.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top