Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to run code to display a userform from a Chart 2

Status
Not open for further replies.

timbo44

Programmer
Nov 5, 2007
8
DE
I have written some VBA code that requires some input from a userform. This code will dynamically control a Chart in Excel. When the Chart is selected and code to display the userform is run the following error occurs:-

Run-time error '1004'

Method 'Range' of '_Global'failed

The code to display the form is:-

Sub show_frmBandBox()
Load frmBandbox
frmBandbox.Show
End Sub

The code works when an ordinary worksheet is selected.

What is causing this error and can it be fixed please. I want to use the userform if possible.

Thanks
 
You should have some code in the UserForm dealing with a Worksheet not suitable for a Chart.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 

If you display the Userform outside the Chart you should have no problems. It seems that trying to show it as a part of the Chart is where you're running into trouble.

[glasses]

----------------------------------------------------------------------------------
"A committee is a life form with six or more legs and no brain." -- L. Long
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top