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

hi all !!
i have this but it gives error for each "wb"...

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

....it is inside a sub that starts like this...

Dim aWB As Workbook
Dim aWS As Worksheet

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


can anybody help pls !!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default launch macro in other workbook

Hi

You have to use the parent object as reference:

For Each wb In Application.Workbooks


Regards,
Per

On 8 Maj, 13:08, pls123 wrote:
hi all !!
*i have this but it gives error for each "wb"...

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

...it is inside a sub that starts like this...

Dim aWB As Workbook
Dim aWS As Worksheet

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

can *anybody help pls !!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default launch macro in other workbook



For Each wb In Workbooks
If (left(wb.name,1) )= "_" Then application.run wb.name &"!" & mymacro
Next wb




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default launch macro in other workbook

thx all !! i will test in the weekend !!

"Przemek" wrote:



For Each wb In Workbooks
If (left(wb.name,1) )= "_" Then application.run wb.name &"!" & mymacro
Next wb





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
UDF won't launch macro hdf Excel Programming 8 June 7th 07 03:17 PM
How to launch an Excel Workbook quickier, by ... SergioF Excel Programming 2 June 3rd 07 04:36 PM
VBA - Launch VBA Macro From VB ajocius[_54_] Excel Programming 2 May 18th 06 02:59 PM
Macro launch - Button vs Manual launch , has different results. Wayne Excel Programming 4 February 23rd 05 11:33 AM
Launch Macro in Access via Macro running in Excel??? dgrant Excel Programming 1 September 24th 03 01:38 PM


All times are GMT +1. The time now is 12:24 PM.

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"