I wrote and tested the code in Excel 2003. I'll see what's going on in 2007.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)
"Flemming" wrote in message
...
Your ExitDesignMode module returns an error on If Ctrl.State < 0
Then -"Run-tiem error '91' - Object variable or with block variable not
set.
Could it be because of the new ribbon in Office 2007 which I use...
Cheers,
Flemming
"Chip Pearson" wrote in message
...
Flemming,
Try code like the following:
Sub EnterDesignMode()
Application.CommandBars.FindControl(ID:=1605).Exec ute
End Sub
Sub ExitDesignMode()
Dim Ctrl As CommandBarControl
Set Ctrl = Application.CommandBars.FindControl(ID:=2597)
If Ctrl.State < 0 Then
Ctrl.Execute
End If
End Sub
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)
"Flemming" wrote in message
...
Hi,
When my macro runs I at some point wants to change into design mode -
knowing that I properly can not get back to run mode with out a manual
act.
Anybody know the code to switch to design mode?
Thanks,
Flemming