PC Review


Reply
Thread Tools Rate Thread

calling sub from other workbook

 
 
pls123
Guest
Posts: n/a
 
      2nd May 2009
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 With Quote
 
 
 
 
ryguy7272
Guest
Posts: n/a
 
      2nd May 2009
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling subroutine defined in another workbook (autostart workbook) Scott Bass Microsoft Excel Programming 5 17th Nov 2010 12:05 PM
Calling open workbook from another workbook Merlynsdad Microsoft Excel Programming 8 20th Oct 2009 04:07 PM
Passing calling workbook name to called workbook =?Utf-8?B?RFJL?= Microsoft Excel Programming 7 6th May 2006 01:34 AM
Calling a Personal.XLS Sub from anther workbook's 'This Workbook' Sheet Activate Jack Gillis Microsoft Excel Discussion 2 21st Mar 2005 11:58 PM
Reference code in another workbook from a calling workbook =?Utf-8?B?RGF0YXNvcnQ=?= Microsoft Excel Programming 1 4th Jan 2005 01:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:40 PM.