jamiguel77

Active Member
Joined
Feb 14, 2006
Messages
378
Office Version
  1. 2016
  2. 2010
  3. 2007
Platform
  1. Windows
  2. Web
hi all
i have this code:

Code:
    Private Const Chart_Source_Range = "Sheet1!$A$1:$B$9"     ' <== Change Chart Source addrs as required
    Range(Chart_Source_Range).Parent.Select
    Application.EnableEvents = True
    Set ws = Range(Chart_Source_Range).Parent
    Set oLbl = Me.Frame1.Controls.Add("Forms.Label.1", "Test", 0)
    Set oChart = CreateChart(Range(Chart_Source_Range), PIE_CHART_TYPE)

my problem is:

i opened a Excel file and stored on a variable named: wbk

i try this:

Set NewSheet = wbk.Sheets("Graficas")
Chart_Source_Range = NewSheet.Range("K66:L78")

in this last line i get an error: 91
Spanish: Variable de objeto o bloque with no establecido

the filename is named: "Budget 2018.xlsx"

how to fix?


thanks
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
i think the variable:

Chart_Source_Range = NewSheet.Range("K66:L78")


have not a String.


how to convert it?


thanks
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,715
Members
448,985
Latest member
chocbudda

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top