Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 2002 VBA macro deployment troubles

Hi,
I have created a spreadsheet with various bits of vba code, and attached
each macro to a custom menu bar, but i have problem when i deploy it to the
network for my users.
on my machine it works fine, when its copied to the network, i get an error
when running the macros "A document with the same name ...... is already
open. you can not open two document .. etc"

the main question is what method should i use to deploy a simple
spreadsheet, for use with 30 employees, 1 person will be entering data, the
rest as read-only.
i don't want to put macro stuff in the personel.xls , and the spreadsheets
location will not be hard coded, as it may change.

i just want to include the code in the sheet, all self contained.

thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Excel 2002 VBA macro deployment troubles

It sounds like your menus still refer to the original location of the file.
Most people use the workbook_open event to totally rebuild the menus so the
correct file is referenced in the onaction property. then in the before
close event, they include code to destroy the menus. As an added assurance,
they use similar code in the workbook_open event to destroy and residual
menus so you don't get duplicates.

On Error Resume Next
' workbook to destroy the menus
On Error goto 0

this bypasses errors if the menus don't exist.

--
regards,
Tom Ogilvy


"Andy CA5" wrote:

Hi,
I have created a spreadsheet with various bits of vba code, and attached
each macro to a custom menu bar, but i have problem when i deploy it to the
network for my users.
on my machine it works fine, when its copied to the network, i get an error
when running the macros "A document with the same name ...... is already
open. you can not open two document .. etc"

the main question is what method should i use to deploy a simple
spreadsheet, for use with 30 employees, 1 person will be entering data, the
rest as read-only.
i don't want to put macro stuff in the personel.xls , and the spreadsheets
location will not be hard coded, as it may change.

i just want to include the code in the sheet, all self contained.

thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 2002 VBA macro deployment troubles

thanks,
do you have any sample code you could post.

"Tom Ogilvy" wrote:

It sounds like your menus still refer to the original location of the file.
Most people use the workbook_open event to totally rebuild the menus so the
correct file is referenced in the onaction property. then in the before
close event, they include code to destroy the menus. As an added assurance,
they use similar code in the workbook_open event to destroy and residual
menus so you don't get duplicates.

On Error Resume Next
' workbook to destroy the menus
On Error goto 0

this bypasses errors if the menus don't exist.

--
regards,
Tom Ogilvy


"Andy CA5" wrote:

Hi,
I have created a spreadsheet with various bits of vba code, and attached
each macro to a custom menu bar, but i have problem when i deploy it to the
network for my users.
on my machine it works fine, when its copied to the network, i get an error
when running the macros "A document with the same name ...... is already
open. you can not open two document .. etc"

the main question is what method should i use to deploy a simple
spreadsheet, for use with 30 employees, 1 person will be entering data, the
rest as read-only.
i don't want to put macro stuff in the personel.xls , and the spreadsheets
location will not be hard coded, as it may change.

i just want to include the code in the sheet, all self contained.

thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Excel 2002 VBA macro deployment troubles

Private Sub Workbook_Open()


Dim objBar As Office.CommandBar


'Delete CommandBar if it exists
On Error Resume Next
Application.CommandBars("DataEntry").Delete
On Error GoTo 0


Set objBar = Application.CommandBars.Add("DataEntry")


With objBar.Controls.Add(temporary:=True)
.Caption = "Anti Virus"
.OnAction = "PasteAntiVirus"
End With


With objBar.Controls.Add(temporary:=True)
.Caption = "Audio"
.OnAction = "PasteAudio"
End With


With objBar.Controls.Add(temporary:=True)
.Caption = "Backup"
.OnAction = "PasteBackup"
End With


End Sub


--
Regards,
Tom Ogilvy


"Andy CA5" wrote:

thanks,
do you have any sample code you could post.

"Tom Ogilvy" wrote:

It sounds like your menus still refer to the original location of the file.
Most people use the workbook_open event to totally rebuild the menus so the
correct file is referenced in the onaction property. then in the before
close event, they include code to destroy the menus. As an added assurance,
they use similar code in the workbook_open event to destroy and residual
menus so you don't get duplicates.

On Error Resume Next
' workbook to destroy the menus
On Error goto 0

this bypasses errors if the menus don't exist.

--
regards,
Tom Ogilvy


"Andy CA5" wrote:

Hi,
I have created a spreadsheet with various bits of vba code, and attached
each macro to a custom menu bar, but i have problem when i deploy it to the
network for my users.
on my machine it works fine, when its copied to the network, i get an error
when running the macros "A document with the same name ...... is already
open. you can not open two document .. etc"

the main question is what method should i use to deploy a simple
spreadsheet, for use with 30 employees, 1 person will be entering data, the
rest as read-only.
i don't want to put macro stuff in the personel.xls , and the spreadsheets
location will not be hard coded, as it may change.

i just want to include the code in the sheet, all self contained.

thanks

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
Excel macro deployment bk1234 Excel Discussion (Misc queries) 0 April 29th 10 07:51 PM
Customized Toolbar Deployment for Excel 2002 morgan Setting up and Configuration of Excel 3 September 22nd 06 02:56 PM
Macro Troubles mastermind Excel Programming 1 August 12th 06 07:41 PM
macro deployment - References DLL issue [email protected] Excel Programming 7 June 2nd 06 10:44 AM
Macro Troubles DR Excel Programming 1 February 15th 06 04:26 PM


All times are GMT +1. The time now is 03:32 AM.

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

About Us

"It's about Microsoft Excel"