Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to read a number (counter) from a file (.txt probably), and add it to
my spreadsheet. Then increment that number by one, and store the result back into the file. The purpose is so different users can open the spreadsheet and get the next available number to number the form. Here's how I did it in Word. How do I do it in Excel? Public Sub MAIN() Dim CheckNum$ Dim docnum$ CheckNum$ = WordBasic.[GetFormResult$]("DocNumField") If CheckNum$ = "00000" Then docnum$ = WordBasic.[GetPrivateProfileString$]("DocTracker", "DocNum", _ "U:\Counter\TemplateCounter.INI") docnum$ = Str((WordBasic.Val(docnum$) + 1)) WordBasic.SetFormResult "DocNumField", docnum$ WordBasic.SetPrivateProfileString "DocTracker", "DocNum", docnum$, _ "U:\Counter\TemplateCounter.INI" ActiveWindow.ActivePane.HorizontalPercentScrolled = 34 End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Reading contents | Excel Discussion (Misc queries) | |||
Reading Contents of a Directory | Excel Programming | |||
reading contents of a file | Excel Programming | |||
Browsing to URL and reading contents | Excel Programming |