View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] a_d_h@hotmail.com is offline
external usenet poster
 
Posts: 1
Default allow user to change workbook while in Msgbox or InputBox

Hi guys,
This is probably a question of vocab - I didn't know the right terms to
search for, so my apologies if this has been answered.

I need to prompt a user to select a chart and then set that chart to a
variable in my code. The trick is that the chart will be in a
different workbook; is there a way to pop up a message, allow the user
to activate a different workbook and then return to the message a click
OK? I don't know if msgbox or inputbox would allow this.

The general schematic is as follows:

Dim ch as Chart
dim ans as Integer
On Error Resume Next
ans = MsgBox("Please Select a Chart to Modify", Buttons:=vbOKCancel)
'this is where I need to allow the user to go activate a chart
'in another workbook, and then come back and click OK.
If ans = vbOK Then
Set ch = ActiveChart
If ch Is Nothing Then
MsgBox "no chart selected"
Else
'chart okay; more code here
End If
Else
'user canceled out
End If

Thanks in advance for your help,
Andrew