Hello,
Help please. I need to use an excel workbook for Quotes for all staff members. multiple computers, same network place. The code is as follows:
'Public Sub QuoteNumber()
Dim ThisInvoice As Long
Dim strDefaultName As String
Dim ReadText As String
Dim StoreFile As String
StoreFile = "T:quotationsquoteno.xls"
'replace with another path,
'network folder if multi-user
'read previous number:
If Dir(StoreFile) = "" Then 'not found
ThisQuote = 1
Else
Open StoreFile For _
Input Access Read As #1
While Not EOF(1)
Line Input #1, ReadText
ThisQuote = Val(ReadText)
Wend
Close #1
End If
ThisQuote = ThisQuote + 1
'Store this number:
Open StoreFile For _
Output Access Write As #1
Print #1, ThisQuote
Close #1
With Range("G3") ' change to suit
.Value = "Quote No.: " & "0000" & ThisQuote
strDefaultName = Range("G5").Value
End With
ActiveWorkbook.SaveAs "T:quotationsQuote No. " & "0000" & ThisQuote & strDefaultName & ".xls"
End Sub '
What should I do that I could use the same workbook saving on the same network drive on different computers.
This code generates a unique number for every quote and saves it to drive T: (same on all computers as network place) with quote number and company name automatically, but unfortunately, just on the computer where it was created.
What can I do to be able to use it on several PC's.
Thanks.
Help please. I need to use an excel workbook for Quotes for all staff members. multiple computers, same network place. The code is as follows:
'Public Sub QuoteNumber()
Dim ThisInvoice As Long
Dim strDefaultName As String
Dim ReadText As String
Dim StoreFile As String
StoreFile = "T:quotationsquoteno.xls"
'replace with another path,
'network folder if multi-user
'read previous number:
If Dir(StoreFile) = "" Then 'not found
ThisQuote = 1
Else
Open StoreFile For _
Input Access Read As #1
While Not EOF(1)
Line Input #1, ReadText
ThisQuote = Val(ReadText)
Wend
Close #1
End If
ThisQuote = ThisQuote + 1
'Store this number:
Open StoreFile For _
Output Access Write As #1
Print #1, ThisQuote
Close #1
With Range("G3") ' change to suit
.Value = "Quote No.: " & "0000" & ThisQuote
strDefaultName = Range("G5").Value
End With
ActiveWorkbook.SaveAs "T:quotationsQuote No. " & "0000" & ThisQuote & strDefaultName & ".xls"
End Sub '
What should I do that I could use the same workbook saving on the same network drive on different computers.
This code generates a unique number for every quote and saves it to drive T: (same on all computers as network place) with quote number and company name automatically, but unfortunately, just on the computer where it was created.
What can I do to be able to use it on several PC's.
Thanks.