LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default How to run a private sub in the workbook from another workbook

Hi,

Currently I have 2 workbooks... WB1 is HSA Yield, WB2 is Pivot Yield.
In WB1, I have a command button link to the private sub name HSAYield ().
In WB2, I have a command button link to the private sub name PivotYield()

Now, I am writing codes in WB1 Private Sub HSA Yield as show below :-
The problem that I am facing is that the last line that states : Call
AllPHC..... cannot be activated. Could somebody help me to resolve this.
Thanks.

Private Sub HSAYield_Click()
'
' HSA Yield Macro
' Macro recorded 6/9/2005
'
' Crunching of Pivot Height Check All Models All Lines Yield
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Worksheets("Selections").Select
Range("D3").Copy
Workbooks.Open Filename:="D:\Templates For HSA\PHC Template All Lines
All Models.xls"
Workbooks("PHC Template All Lines All Models.xls").Activate
Worksheets("Selections").Select
ActiveSheet.Range("B4").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Call AllPHCStationsAllModels1stAndFinalPass_Click

End Sub
 
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
re : Possible to run private sub macros by writing another private ddiicc Excel Programming 5 August 26th 05 04:49 AM
Running a macro to protect a workbook on a already protected workbook UNprotects the workbook ?? WimR Excel Programming 9 July 25th 05 12:44 PM
Private Sub Running Other Private Sub Inadvertently Ross Culver Excel Programming 2 February 10th 05 07:17 PM
Add code to Private Sub ComboBox1_Change() with a macro from a different workbook help_wanted[_2_] Excel Programming 4 April 2nd 04 06:47 PM
What commands do you use to name a workbook, save a workbook,open a workbook Steven R. Berke Excel Programming 1 July 24th 03 11:37 PM


All times are GMT +1. The time now is 07:00 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"