I am trying to run a graph that requires a layout which is not the main one Excel has. Apparently they have the same chart type even though the layout is quite different.
Public nome_grafico As String
Public nome_planilha_grafico As String
Public numeroTermicas As Integer
Sub cria_grafico()
    Dim graf_ativo As String
    nome_planilha_grafico = ActiveSheet.Name
    numeroTermicas = Worksheets(nome_planilha_grafico).Cells(1, 6).Value
    Worksheets(nome_planilha_grafico).Range(Cells(2, 1), Cells(numeroTermicas + 1, 2)).Select
    ActiveSheet.Shapes.AddChart2(297, xlColumnStacked).Select
    ActiveChart.SetSourceData Source:=Worksheets(nome_planilha_grafico).Range(Cells(2, 1), Cells(numeroTermicas + 1, 2))
    ActiveChart.ChartType = xlColumnStacked
    graf_ativo = ActiveChart.Name
    nome_grafico = Right(graf_ativo, (Len(graf_ativo) - (Len(nome_planilha_grafico) + 1)))
End Sub
 
    