Excel/control id

Advertisement


Question
Gyula:

I use:

Application.CommandBars.FindControl(id:=1605).Execute

to enter design mode. From what I can find, this is also the id for exit design mode, but if I execute the code, it only turns on the design mode. Please, what is the vba to exit design mode?

Sherry

Answer
Here you go:
Sub EnterDesignMode()
   Application.CommandBars.FindControl(ID:=1605).Execute
End Sub

Sub ExitDesignMode()
With CommandBars("Exit Design Mode").Controls(1)
   If .State = msoButtonDown Then .Execute
End With
End Sub

HTH,
Gyula
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Gyula Gulyas

Expertise

I can answer most questions related to macros, worksheet functions, VBA, Office automation (calling/using other MS Office programs) and geocoding using Google Maps. I have 10 years experience using and programming in MS Excel and other office applications. I have extensive experience linking and using DLLs in Excel.

Experience

Macros, worksheet functions, VBA, linking of DLLs and Office automation, geocoding using Google Maps.

©2012 About.com, a part of The New York Times Company. All rights reserved.