i have a sheet that connects to an oracle database. i want to be able to have vba that will copy a sheet from that workbook post the values and formatting in to another workbook in a server location and rename that tab(worksheet) to todays date.
i already have the oracle connection going collecting the data just having an issue with my vba it get an error... any help would be greatly appreciated
Code
Sub Test()
'Update Links
ActiveWorkbook.UpdateLink Name:=ActiveWorkbook.LinkSources, Type:=xlExcelLinks
'Refresh Workbook
Workbooks("TWO WEEK COUNT 2022").RefreshAll
'Shut off Prompts
Application.DisplayAlerts = False
'Open a workbook
'Open method requires full file path to be referenced.
Workbooks.Open "\\serverpath\2 Week Count.xlsx"
Workbooks("TWO WEEK COUNT 2022.xlsm").Activate
Sheets("2018 1 Hour Counts").Copy After:=Workbooks("2 Week Count.xlsx").Sheets(Workbooks("2 Week Count.xlsx").Sheets.Count)
ActiveSheet.Range("A1:AI80").Copy
ActiveSheet.Range("A1:AI80").PasteSpecial xlPasteValues
ActiveSheet.Shapes("Rectangle: Rounded Corners 1").Delete
ActiveSheet.Shapes("Rectangle: Rounded Corners 2").Delete
Dim Val As String
Val = Sheets("2018 1 Hour Counts").Format(Date"MMM DD").Value
ActiveSheet.Name = Val
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub
Display More