Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Upgrade VBA code from 2003 to 2007


Dear all,

I'm working on a project to upgrade a excel-vba based program from
excel 2003 to 2007.

The program is a stand-alone excel file with VBA code, in order to
pretend to be a normal program, it hide all excel menus and disable all
excel functions, replace with its own menu.

It is easy to implement that in Excel 2003 throught controlling
Commandbar object. but for excel 2007, I found ribbon is totally
differet with classic commandbar, so I need some help.

What I want to do is:
Hide all excel menus, replace with my own stuff, make it looks like the
normal program.

What I already knew:
I found some articles in MSDN, which tell me that customUI.xml can be
used to modify the ribbon menu. I tried and it did work for ribbon tabs.
but still 3 buttons in office menu "New", "Open", "Save", as well as
list of recent open file remains

What I'd like to ask he
1. how to remove all buttons and list of recent open file on office
menu ?
2. Is it the easiest way to use xml file to customize the ribbon menu ?
if not, what's other possibilities ?
3. for vba code upgrading from 2003 to 2007, as I just start this
project, I am not aware of what kinds of problem I may meet, can anyone
share some general tips ?


--
lmzhuee
------------------------------------------------------------------------
lmzhuee's Profile: http://www.thecodecage.com/forumz/member.php?userid=683
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=125794

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Upgrade VBA code from 2003 to 2007

try this. you might need to adapt a little as this is cut out of a project i
have done

Sub Disable_on_version07()

'turn off autosave
Application.AutoRecover.Enabled = False

'ExecuteExcel4Macro portion by Jim Rech
'Other code Nick hodge
With Application
.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
.CommandBars("Status Bar").Visible = False
.DisplayFormulaBar = False
.DisplayScrollBars = True
.ActiveWindow.DisplayHeadings = False
.ActiveWindow.DisplayWorkbookTabs = False
End With

KeyCombos (False)

'make all the worksheets visible
For Each c In Sheets
c.Visible = True
Next c

End Sub

Sub enable_on_version07()

'turn on autosave
Application.AutoRecover.Enabled = True

'ExecuteExcel4Macro portion by Jim Rech
'Other code Nick hodge
With Application
.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",true)"
.CommandBars("Status Bar").Visible = True
.DisplayFormulaBar = True
.DisplayScrollBars = True
.ActiveWindow.DisplayHeadings = True
.ActiveWindow.DisplayWorkbookTabs = True
End With

KeyCombos (True)

'make all the worksheets visible
For Each c In Sheets
If (c.Visible = False) Then
c.Visible = True
End If
Next c
End Sub

the ribbon code section was found online and is not mine so I am not taking
credit for it.

the key combos function is just a call to turn of key strokes.

regards

Anthony

"lmzhuee" wrote in message
...

Dear all,

I'm working on a project to upgrade a excel-vba based program from
excel 2003 to 2007.

The program is a stand-alone excel file with VBA code, in order to
pretend to be a normal program, it hide all excel menus and disable all
excel functions, replace with its own menu.

It is easy to implement that in Excel 2003 throught controlling
Commandbar object. but for excel 2007, I found ribbon is totally
differet with classic commandbar, so I need some help.

What I want to do is:
Hide all excel menus, replace with my own stuff, make it looks like the
normal program.

What I already knew:
I found some articles in MSDN, which tell me that customUI.xml can be
used to modify the ribbon menu. I tried and it did work for ribbon tabs.
but still 3 buttons in office menu "New", "Open", "Save", as well as
list of recent open file remains

What I'd like to ask he
1. how to remove all buttons and list of recent open file on office
menu ?
2. Is it the easiest way to use xml file to customize the ribbon menu ?
if not, what's other possibilities ?
3. for vba code upgrading from 2003 to 2007, as I just start this
project, I am not aware of what kinds of problem I may meet, can anyone
share some general tips ?


--
lmzhuee
------------------------------------------------------------------------
lmzhuee's Profile: http://www.thecodecage.com/forumz/member.php?userid=683
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=125794



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Upgrade VBA code from 2003 to 2007

but still 3 buttons in office menu "New", "Open", "Save", as well as
list of recent open file remains


See the Dictator example on my site
http://www.rondebruin.nl/ribbon.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"lmzhuee" wrote in message ...

Dear all,

I'm working on a project to upgrade a excel-vba based program from
excel 2003 to 2007.

The program is a stand-alone excel file with VBA code, in order to
pretend to be a normal program, it hide all excel menus and disable all
excel functions, replace with its own menu.

It is easy to implement that in Excel 2003 throught controlling
Commandbar object. but for excel 2007, I found ribbon is totally
differet with classic commandbar, so I need some help.

What I want to do is:
Hide all excel menus, replace with my own stuff, make it looks like the
normal program.

What I already knew:
I found some articles in MSDN, which tell me that customUI.xml can be
used to modify the ribbon menu. I tried and it did work for ribbon tabs.
but still 3 buttons in office menu "New", "Open", "Save", as well as
list of recent open file remains

What I'd like to ask he
1. how to remove all buttons and list of recent open file on office
menu ?
2. Is it the easiest way to use xml file to customize the ribbon menu ?
if not, what's other possibilities ?
3. for vba code upgrading from 2003 to 2007, as I just start this
project, I am not aware of what kinds of problem I may meet, can anyone
share some general tips ?


--
lmzhuee
------------------------------------------------------------------------
lmzhuee's Profile: http://www.thecodecage.com/forumz/member.php?userid=683
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=125794

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Upgrade VBA code from 2003 to 2007


Hi Ron de Bruin,

I downloaded the example from your site, it's exactly what I need,
especially the code to get rid of MRU list is interesting and practical,
quite helpful for me, thank you very much.

Thanks for sharing your project, Anthony, I learned an easier way to
deal with Ribbon.


--
lmzhuee
------------------------------------------------------------------------
lmzhuee's Profile: http://www.thecodecage.com/forumz/member.php?userid=683
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=125794

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Keeping 2003 After Upgrade to 2007 LarryP Excel Discussion (Misc queries) 3 February 24th 10 10:22 PM
Fast code in 2003 = agonizingly slow code in 2007 XP Excel Programming 25 October 21st 08 01:01 PM
2003--2007 recognize if i'm in 2007 or 2003 via code. Miri Excel Programming 3 October 15th 08 02:50 PM
Code not working since upgrade to 2007 Terry K Excel Programming 2 January 4th 08 07:39 PM
How do I upgrade to 2003 shapiro Excel Discussion (Misc queries) 4 December 18th 06 07:59 PM


All times are GMT +1. The time now is 05:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"