We have a number of individuals entering student test data into a complex Excel 2010 spread sheet. Each child is assigned a unique study number 1 - 9999.
I originally had a macro that would increment a desktop counter via the local network each time a student's basic data was entered into its own workbook file (one per student).
Until recently, this worked fine, providing the next available student number to be assigned. When entered, the counter would increment +1. Problems arose because some, on site, were using Excel 2003 and others Excel 2010 when the naming/path conventions for "desktop" changed.
A new wrinkle now has some entering data offsite , off-network.
Is there a way to convert this macro to FTP the latest available student number to a common web page? I have access to a fixed IP address.
I originally had a macro that would increment a desktop counter via the local network each time a student's basic data was entered into its own workbook file (one per student).
Code:
Sub ID_Counter()
Dim s As String, count As Long
s = "C:\Documents and Settings\All Users\Desktop\Counter.txt"
count = ReadCounter(s)
IncCounter (s)
count = ReadCounter(s)
Sheets("SDC").Range("F44").Value = count
End Sub
Sub IncCounter(toFile As String)
Dim iHandle As Integer, counter As Long
On Error Resume Next
counter = ReadCounter(toFile)
iHandle = FreeFile
Open toFile For Output Access Write As #iHandle
Print #iHandle, counter + 1
Close #iHandle
End Sub
Function ReadCounter(filePath As String) As Long
Dim str As String, hFile As Integer
On Error Resume Next
hFile = FreeFile
Open filePath For Binary Access Read As #hFile
str = Input(LOF(hFile), hFile)
ReadCounter = str
Close hFile
End Function
Until recently, this worked fine, providing the next available student number to be assigned. When entered, the counter would increment +1. Problems arose because some, on site, were using Excel 2003 and others Excel 2010 when the naming/path conventions for "desktop" changed.
A new wrinkle now has some entering data offsite , off-network.
Is there a way to convert this macro to FTP the latest available student number to a common web page? I have access to a fixed IP address.