Hello
From MS Access, I am learning how to export and format charts to Excel.

Here I have some VBA code that transfers from MS Access a query and creates a chart into Excel.

My question is, from the code below, is there any way for it to Format the chart to xlBarStacked and fit the height equal to row lines with data on the query worksheet?

This is my code:

Private Sub cmbexpqryxlBarStacked_Click()   


     Dim wb, ws, xl, ch, qry_createbarstacked as Object
     Dim sExcelWB As String
  
     sExcelWB = TrailingSlash(CurrentProject.Path) & "qry_createbarstacked.xlsx"
     DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "qry_createbarstacked", sExcelWB, True


     Set wb = xl.Workbooks.Open(sExcelWB)
     Set ws = wb.Sheets("qry_createbarstacked")
     Set ch = ws.Shapes.AddChart.Chart
     Set mychart = ws.ChartObjects("Chart 1")


End Sub
Thanks very much for the help.