guys,
i create a form that create an xls with the form's values.
then i try to modify it properties and to create a chart.
this code, change the title of one value and create the cart in a new worksheets called CHART1.
issues:
1- I DONT want to create the chart in a new worksheet, i want it in the "ooooooo" sheet.
2- when i try to change the chart to be a pie, an error appears
"variable not defined"
any suggestion? thx, max.
i create a form that create an xls with the form's values.
Code:
DoCmd.OutputTo acOutputForm, "ooooooo", acFormatXLS, "d:\ooooooo.xls", False
then i try to modify it properties and to create a chart.
Code:
Dim xlApp As Object
Dim xlSheet As Object
Set xlApp = CreateObject("Excel.Application")
Set xlSheet = xlApp.Workbooks.Open("d:\ooooooo.xls").Sheets(1)
With xlApp
.Application.Sheets("ooooooo").Select
.Application.Range("A1").Select
.Application.Selection.Font.Bold = True
.Application.Range("B1").Select
.Application.ActiveCell.FormulaR1C1 = "solo"
.Application.Charts.Add
.Application.ActiveChart.ChartType = xlPie
.Application.ActiveChart.SetSourceData Source:=Sheets("0000000").Range("A2:B2"), PlotBy:=xlRows
.Application.ActiveChart.Location Where:=xlLocationAsObject, name:="ooooooo"
.Application.ActiveChart.ApplyDataLabels Type:=xlDataLabelsShowLabelAndPercent, LegendKey:=False, HasLeaderLines:=True
.Application.Activeworkbook.Save
.Application.Activeworkbook.Close
.Application.Quit
End With
Set xlApp = Nothing
Set xlSheet = Nothing
vStatusBar = SysCmd(acSysCmdClearStatus)
this code, change the title of one value and create the cart in a new worksheets called CHART1.
issues:
1- I DONT want to create the chart in a new worksheet, i want it in the "ooooooo" sheet.
2- when i try to change the chart to be a pie, an error appears
"variable not defined"
any suggestion? thx, max.