I want the code to get the path from an access table. Table Name= (tblExportsImports) Field Name = (DailyReport_Export)
Example: Set xlWb = .Workbooks.Open (tblExportsImports.DailyReport_Export)
Code:
Private Sub cmdSummaryReport_Click()
DoCmd.SetWarnings False
basChart.BuildChartData
DoCmd.SetWarnings False
Dim xlApp As Excel.Application
Dim xlWb As Excel.Workbook
Set xlApp = New Excel.Application
With xlApp
.Visible = True
Set xlWb = .Workbooks.Open("\\rampbess004\GroupV\OPS\RelMaint TAR\TAR GoC\GoC TAR's\TAR GoC-2019\FS2\Daily Report\Daily Report.xlsm", , False)
xlWb.RefreshAll
DoEvents
xlWb.SaveAs FileName:="\\rampbess004\GroupV\OPS\RelMaint TAR\TAR GoC\GoC TAR's\TAR GoC-2019\FS2\Daily Report\ " & "FS2 Daily Report" & " " & Format(Now, "MM-dd-yy H.MMAMPM") & ".xlsm", FileFormat:=52
End With
DoCmd.SetWarnings True
End Sub
Example: Set xlWb = .Workbooks.Open (tblExportsImports.DailyReport_Export)
Code:
Private Sub cmdSummaryReport_Click()
DoCmd.SetWarnings False
basChart.BuildChartData
DoCmd.SetWarnings False
Dim xlApp As Excel.Application
Dim xlWb As Excel.Workbook
Set xlApp = New Excel.Application
With xlApp
.Visible = True
Set xlWb = .Workbooks.Open("\\rampbess004\GroupV\OPS\RelMaint TAR\TAR GoC\GoC TAR's\TAR GoC-2019\FS2\Daily Report\Daily Report.xlsm", , False)
xlWb.RefreshAll
DoEvents
xlWb.SaveAs FileName:="\\rampbess004\GroupV\OPS\RelMaint TAR\TAR GoC\GoC TAR's\TAR GoC-2019\FS2\Daily Report\ " & "FS2 Daily Report" & " " & Format(Now, "MM-dd-yy H.MMAMPM") & ".xlsm", FileFormat:=52
End With
DoCmd.SetWarnings True
End Sub