Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Is it possible to call a subroutine from another workbook? I have a subroutine called TestSub in my "*Test Book.xls*" workbook. open this book, then try to call subroutine (-TestSub-) in that book. Code ------------------- If frmDate.chkATime Then Set wb = Workbooks("Test Book.xls") If wb = Nothing Then Workbooks.Open "C:\Test Folder\Test Book.xls", False, True End If Call TestSub Workbooks("Test Book.xls").Close False End I ------------------- Is this even possible? TIA, DejaV -- DejaV ----------------------------------------------------------------------- DejaVu's Profile: http://www.excelforum.com/member.php...fo&userid=2262 View this thread: http://www.excelforum.com/showthread.php?threadid=48187 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if Test Book.xls is open then
Sub RunTestsub() Application.Run "'Test Book.xls'!TestSub" End Sub Worked for me. -- Regards, Tom Ogilvy "DejaVu" wrote in message ... Is it possible to call a subroutine from another workbook? I have a subroutine called TestSub in my "*Test Book.xls*" workbook. I open this book, then try to call subroutine (-TestSub-) in that book. Code: -------------------- If frmDate.chkATime Then Set wb = Workbooks("Test Book.xls") If wb = Nothing Then Workbooks.Open "C:\Test Folder\Test Book.xls", False, True End If Call TestSub Workbooks("Test Book.xls").Close False End If -------------------- Is this even possible? TIA, DejaVu -- DejaVu ------------------------------------------------------------------------ DejaVu's Profile: http://www.excelforum.com/member.php...o&userid=22629 View this thread: http://www.excelforum.com/showthread...hreadid=481877 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks Tom - That was exactly what I was looking for. I just couldnt find the right syntax for it. DejaVu -- DejaVu ------------------------------------------------------------------------ DejaVu's Profile: http://www.excelforum.com/member.php...o&userid=22629 View this thread: http://www.excelforum.com/showthread...hreadid=481877 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Call a subroutine using variable subroutine name | Excel Discussion (Misc queries) | |||
How do I call number values form one workbook to another workbook | Excel Worksheet Functions | |||
Calling a Public Subroutine in a Different Workbook | Excel Programming | |||
Call Subx for excel 97 Add-In subroutine | Excel Programming | |||
Subroutine call without file reference | Excel Programming |