schnabs
Technical User
- Jan 21, 2009
- 50
Hello. I have a code that runs through a DIR of Excel sheets and updates them. What I am looking to do, is before it refreshes my Excel query, I want to insert a date on the current workbook. But I want a calendar to pop up and the user to select the date. My code is as follows:
Do While temp <> ""
oxlbook = oxl.Workbooks.Open("Z:\Quickbooks Properties\Reports\Delinquency Summary\" + temp)
oxl.Visible = True
oxl.ActiveSheet.pagesetup.centerheadear = "&""Arial,Bold""&12&F" & Chr(10) & Calendar.click
oxl.Run("'Z:\DelinquencySpreadsheet.xls'!SummaryHeader")
oxl.ActiveSheet.querytables(1).refresh()
oxl.ActiveSheet.querytables(2).refresh()
oxl.Columns.AutoFit()
oxl.ActiveWorkbook.SaveAs("Z:\2009 Combined Delinquencies\Summary\" + temp)
oxl.ActiveWorkbook.Close()
temp = Dir()
Loop
Where I update the header, I want the second part to pull the date from the calendar that the user selected. However, I only want the selection to occur once. My loop goes through 75 Excel files, and I only want the date selected once.
Thanks!
Do While temp <> ""
oxlbook = oxl.Workbooks.Open("Z:\Quickbooks Properties\Reports\Delinquency Summary\" + temp)
oxl.Visible = True
oxl.ActiveSheet.pagesetup.centerheadear = "&""Arial,Bold""&12&F" & Chr(10) & Calendar.click
oxl.Run("'Z:\DelinquencySpreadsheet.xls'!SummaryHeader")
oxl.ActiveSheet.querytables(1).refresh()
oxl.ActiveSheet.querytables(2).refresh()
oxl.Columns.AutoFit()
oxl.ActiveWorkbook.SaveAs("Z:\2009 Combined Delinquencies\Summary\" + temp)
oxl.ActiveWorkbook.Close()
temp = Dir()
Loop
Where I update the header, I want the second part to pull the date from the calendar that the user selected. However, I only want the selection to occur once. My loop goes through 75 Excel files, and I only want the date selected once.
Thanks!