Dialog box causes VBA runtime error with Application.Goto re

strorg

Board Regular
Joined
Mar 27, 2002
Messages
112
The following VBA routine runs fine unless I try to execute it from a dialog
box. It then crashes on the |Application.Goto reference:="taglist_origin"|
line of code with a |Method 'Goto' of 'object _Application' failed| message.

Sub APen1_AddP()

Dim Choice, Tag, ColNum As String
Dim Index, Counter As Integer


Application.ScreenUpdating = False
Application.Calculation = xlManual

With DialogSheets("DialogAPen1")
Index = .ListBoxes("List Box APen1").Value
Choice = .ListBoxes("List Box APen1").List(Index)
End With

'Loop through the tag list to find the tag that matches the selection.

Application.Goto reference:="taglist_origin"
Counter = 0
Do While Counter < 250
Counter = Counter + 1
Selection.Offset(1, 0).Select
Tag = ActiveCell.Value
If Tag = Choice Then Exit Do
Loop


Etc.....
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,213,533
Messages
6,114,179
Members
448,554
Latest member
Gleisner2

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