I've been learning VB as I go along for this application but the scenario is this:
I have a VB script running in a label printing program called Bartender. I currently have the script running at the time a user prints a label, it opens up a spreadsheet, updates information, saves then closes the spreadhseet with some code I managed to (just about) throw together as below:
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("\\dt01.local\files$\UserFolders\samc\My Documents\Booker Card Printer\Printed Docs.xlsx")
objExcel.Application.Visible = True
objWorkbook.WorkSheets(1).Activate
objWorkbook.WorkSheets(1).Cells(1, 1).Value = "Test value2"
objExcel.ActiveWorkbook.Save
objExcel.ActiveWorkbook.Close
objExcel.Application.Quit
Using resources I could only find the code which would update a specified cell with the information given (1,1 for example). What I really need is for the code to move to the subsequent blank row below each time a label is printed to avoid overwriting information but I am stumped as to how to write this.
At this stage only one item is needed to be written to the spreadsheet so it will be restricted to column A, this will be variable data instead of fixed text as the script shows but I am fairly certain that's an easy change I can make, I'd like to get the data sequencing right first.
Any help would be appreciated
I have a VB script running in a label printing program called Bartender. I currently have the script running at the time a user prints a label, it opens up a spreadsheet, updates information, saves then closes the spreadhseet with some code I managed to (just about) throw together as below:
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("\\dt01.local\files$\UserFolders\samc\My Documents\Booker Card Printer\Printed Docs.xlsx")
objExcel.Application.Visible = True
objWorkbook.WorkSheets(1).Activate
objWorkbook.WorkSheets(1).Cells(1, 1).Value = "Test value2"
objExcel.ActiveWorkbook.Save
objExcel.ActiveWorkbook.Close
objExcel.Application.Quit
Using resources I could only find the code which would update a specified cell with the information given (1,1 for example). What I really need is for the code to move to the subsequent blank row below each time a label is printed to avoid overwriting information but I am stumped as to how to write this.
At this stage only one item is needed to be written to the spreadsheet so it will be restricted to column A, this will be variable data instead of fixed text as the script shows but I am fairly certain that's an easy change I can make, I'd like to get the data sequencing right first.
Any help would be appreciated