Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default calling sub from other workbook

hi all !
i have the main workbook that must make his calulations,
then all other workbooks will copy updated values,

so to have total control of the flow..
i need to call the copying macro of the secundary pages,
from the main page ..

i got this from a friend of the forum..to call the macro
in each workbook wich name begins with "_" character

for better control..


For Each wb In Workbooks
If (left(wb.name,1) )= "_" Then
'Call Mia
End if
Next wb


but it doesn't work , reporting debug problem for each "wb"..

this is the workbook where it must be placed, but necessarily after the
"call plt" row
tx all for attention with my bad grammar !!


Public Sub RunTimer()

Dim aWB As Workbook
Dim aWS As Worksheet

Set aWB = ThisWorkbook
Set aWS = aWB.Worksheets("Sheet1")

With aWS.Range("O8")
.Value = .Value + TimeSerial(0, 0, 2)
.NumberFormat = "hh:mm:ss"
End With
nTime = Now + TimeSerial(0, 0, 2)
Call plt
Application.OnTime nTime, "RunTimer"

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default calling sub from other workbook

Something like this should get you close:
http://www.rondebruin.nl/ado.htm
http://www.rondebruin.nl/copy7.htm

HTH,
Ryan---
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"pls123" wrote:

hi all !
i have the main workbook that must make his calulations,
then all other workbooks will copy updated values,

so to have total control of the flow..
i need to call the copying macro of the secundary pages,
from the main page ..

i got this from a friend of the forum..to call the macro
in each workbook wich name begins with "_" character

for better control..


For Each wb In Workbooks
If (left(wb.name,1) )= "_" Then
'Call Mia
End if
Next wb


but it doesn't work , reporting debug problem for each "wb"..

this is the workbook where it must be placed, but necessarily after the
"call plt" row
tx all for attention with my bad grammar !!


Public Sub RunTimer()

Dim aWB As Workbook
Dim aWS As Worksheet

Set aWB = ThisWorkbook
Set aWS = aWB.Worksheets("Sheet1")

With aWS.Range("O8")
.Value = .Value + TimeSerial(0, 0, 2)
.NumberFormat = "hh:mm:ss"
End With
nTime = Now + TimeSerial(0, 0, 2)
Call plt
Application.OnTime nTime, "RunTimer"

End Sub

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
Calling a sub from a different workbook jdcox1999 Excel Programming 1 September 22nd 06 05:56 PM
Passing calling workbook name to called workbook DRK Excel Programming 7 May 6th 06 01:34 AM
Calling another workbook Patrick Simonds Excel Programming 5 April 3rd 06 06:29 PM
Reference code in another workbook from a calling workbook Datasort Excel Programming 1 January 4th 05 01:13 AM
calling sub from another workbook James[_9_] Excel Programming 1 October 14th 03 06:06 PM


All times are GMT +1. The time now is 11:06 AM.

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"