Hi,
I want to export a excel file from access and i want to save the excel file in the name based on my selection available in combo box . I am using the below mentioned code, but i am not getting the desired outout file saved in the path mentioned...
Can you please anyone help me on this;
Private Sub Command0_Click()
Dim objXL As Object
Dim strpath As String
On Error Resume Next
Set objXL = GetObject(, "Excel.Application")
Set objXL = GetObject("F:\DB Practice\File Template.xlsx")
objXL.Application.Visible = True
objXL.Parent.Windows(1).Visible = True
DoCmd.TransferSpreadsheet acExport, , "Vin_Qry_UK_RFT", "F:\DB Practice\File Template.xlsx", True, "RFT"
strpath = ("F:\DB Practice\File Template& _ &combo3.xlsx")
xlsx.SaveAs FileName:=(strpath), FileFormat:=56
end sub
Here combo3 is the value i am getting it from query in a combo box....
I want to export a excel file from access and i want to save the excel file in the name based on my selection available in combo box . I am using the below mentioned code, but i am not getting the desired outout file saved in the path mentioned...
Can you please anyone help me on this;
Private Sub Command0_Click()
Dim objXL As Object
Dim strpath As String
On Error Resume Next
Set objXL = GetObject(, "Excel.Application")
Set objXL = GetObject("F:\DB Practice\File Template.xlsx")
objXL.Application.Visible = True
objXL.Parent.Windows(1).Visible = True
DoCmd.TransferSpreadsheet acExport, , "Vin_Qry_UK_RFT", "F:\DB Practice\File Template.xlsx", True, "RFT"
strpath = ("F:\DB Practice\File Template& _ &combo3.xlsx")
xlsx.SaveAs FileName:=(strpath), FileFormat:=56
end sub
Here combo3 is the value i am getting it from query in a combo box....