Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Problem with a macro changing paths

Each month I update hundreds of reports (Excel Workbooks) and place
them on a shared network drive (K:\Library). To facilitate retrieval
of these reports I built a Report Selection menu. This is an Excel
file with a UserForm and numerous VB controls to select specific
reports. This menu is then placed on the end user's hard drive
(C:\Library). When the user needs a specific report they open the menu
and select their report. This in turn retrieves the report off the
share drive, and it pops up on the users screen. Everything is fine up
to here.

There is a 'Return to Library' Command Button on each report with a
macro that is supposed to close the report and return the user to a
specific page of the menu.

My problem is when anyone clicks the 'Return to Menu' Command Button it
returns an error stating the macro cannot be found. What is strange is
the path appearing in the error message indicates it is looking for the
'Return' macro on the share drive (K:\), when it is supposed to be
looking for the macro on the menu which is located on the C:\ drive.
When I check the Command Button and check Assign Macro sure enough the
Macro name has changed reflecting the correct folder and file names,
but it changed the drive from C:\ to the shared K:\. So I understand
the error since the macro does not reside where it is looking.

How do I correct the system so it 'locks' the location of the macro and
doesn't change paths.

Many thanks for any help

Tony

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Problem with a macro changing paths

In the workbook_Open event, change the onaction property of the button to
point to the correct location.

--
Regards,
Tom Ogilvy


wrote in message
oups.com...
Each month I update hundreds of reports (Excel Workbooks) and place
them on a shared network drive (K:\Library). To facilitate retrieval
of these reports I built a Report Selection menu. This is an Excel
file with a UserForm and numerous VB controls to select specific
reports. This menu is then placed on the end user's hard drive
(C:\Library). When the user needs a specific report they open the menu
and select their report. This in turn retrieves the report off the
share drive, and it pops up on the users screen. Everything is fine up
to here.

There is a 'Return to Library' Command Button on each report with a
macro that is supposed to close the report and return the user to a
specific page of the menu.

My problem is when anyone clicks the 'Return to Menu' Command Button it
returns an error stating the macro cannot be found. What is strange is
the path appearing in the error message indicates it is looking for the
'Return' macro on the share drive (K:\), when it is supposed to be
looking for the macro on the menu which is located on the C:\ drive.
When I check the Command Button and check Assign Macro sure enough the
Macro name has changed reflecting the correct folder and file names,
but it changed the drive from C:\ to the shared K:\. So I understand
the error since the macro does not reside where it is looking.

How do I correct the system so it 'locks' the location of the macro and
doesn't change paths.

Many thanks for any help

Tony



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Problem with a macro changing paths

Thanks Tom,

that did it...

Tony

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 2007 - Link paths keep changing shester Excel Discussion (Misc queries) 0 October 3rd 07 10:33 PM
Macro paths wrong after save Kevin M[_2_] Excel Discussion (Misc queries) 3 April 17th 07 03:24 PM
Paths Ross[_2_] New Users to Excel 1 April 4th 07 11:35 PM
Assign Macro & Paths Bill James[_2_] Excel Programming 1 October 24th 05 11:31 PM
changing a recorded macro - date problem.... Daan Excel Programming 5 September 23rd 05 04:19 PM


All times are GMT +1. The time now is 10:22 PM.

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"