call a sub from an xls file on the network

XDKYX

New Member
Joined
Oct 1, 2008
Messages
11
I'm trying to call a sub in an exce. file that resides on our network drive so that multiple users can access the programs that I develop and I can get VBA to open the file but I can't get it to open the sub titled "DCU". I keep getting the following error.
Cannot run the macro DCU. The macro may not be available in this workbook or all macros may be disabled.
Here is my code that errors.
Rich (BB code):
Option Explicit
Sub DESCRIPTION_CLEANER_UPPER()
Application.Visible = True
Workbooks.Open Filename:= _
        "\\Cansvp01\grp_01f\Common\Common-Parts\Prcng\Macros\Macros.xls"
Application.Run "DCU"
End Sub
Any help is greatly appreciated, maybe I'm calling it wrong or maybe there's another way to accomplish what I'm trying to do here.
 
The read-only file in the XLSTART folder works like a charm, thank you so much!

######### SOLVED #########
 
Upvote 0

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
The final solution (for me) was to put the file Macro.xls on a network drive and then make it read-only in the file's properties. From there I put a shortcut in the 'XLSTART' folder so that it started up everytime I started Excel. At that point when I go to run a macro my DESCRIPTION_CLEANER_UPPER macro is available and I don't need another macro to point to it.
Thanks for all of your help guys, I don't know where I would be without that support.
Other forums I posted in:
http://www.xtremevbtalk.com/showthread.php?p=1306578
http://www.mrexcel.com/forum/showthread.php?p=1701261
http://www.excelforum.com/excel-programming/657235-call-a-sub-from-an-xls-file-on-the-network.html
 
Upvote 0
Thats great to hear that it worked. Did you do anything with the visible window?
 
Upvote 0
Yes, (since I'm using 2007) I went to the View tab on the ribbon and clicked on the 'hide' button (in the Window section) while I had the Macro.xls open and now it's hidden for me and anyone else who opens it.
 
Upvote 0

Forum statistics

Threads
1,215,980
Messages
6,128,079
Members
449,418
Latest member
arm56

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top