Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Does Workbook.Open ever run from a Function Call?

I have code that opens a Workbook.

When this code runs in Workbook_Open() it works fine. However when I
execute the same code in a normal Function call it doesn't work.

I have moved the code that does the actual opening of the workbook to a
different subroutine "Test_Call". When I call it from Workbook_Open, it
works. When I call it from a Function Call, it doesn't work. When I put
the call to "Test_Call" into a Macro, it works.

Do you have any idea what's going on?

Mac Lingo


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Does Workbook.Open ever run from a Function Call?

If you're calling the function via a worksheet formula it will not work.
Formulas only return a value to the cell they are in. They cannot affect
other cells or perform any actions.

--
Jim
"Mac Lingo" wrote in message
link.net...
I have code that opens a Workbook.

When this code runs in Workbook_Open() it works fine. However when I
execute the same code in a normal Function call it doesn't work.

I have moved the code that does the actual opening of the workbook to a
different subroutine "Test_Call". When I call it from Workbook_Open, it
works. When I call it from a Function Call, it doesn't work. When I put
the call to "Test_Call" into a Macro, it works.

Do you have any idea what's going on?

Mac Lingo




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Does Workbook.Open ever run from a Function Call?

If you are calling form a VBA function, either

a) precede the call by thisworkbook, e.g. thisworkbook.workbook_open
b) move the code to a procedure in a normal code module and call that (from
the Workbook_Open as well)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jim Rech" wrote in message
...
If you're calling the function via a worksheet formula it will not work.
Formulas only return a value to the cell they are in. They cannot affect
other cells or perform any actions.

--
Jim
"Mac Lingo" wrote in message
link.net...
I have code that opens a Workbook.

When this code runs in Workbook_Open() it works fine. However when I
execute the same code in a normal Function call it doesn't work.

I have moved the code that does the actual opening of the workbook to a
different subroutine "Test_Call". When I call it from Workbook_Open, it
works. When I call it from a Function Call, it doesn't work. When I

put
the call to "Test_Call" into a Macro, it works.

Do you have any idea what's going on?

Mac Lingo






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
Call workbook function Selina Excel Programming 2 April 21st 05 01:11 PM
Call function from one workbook that resides in another workbook m Datasort Excel Programming 3 January 16th 05 10:33 PM
How to call a function from another workbook Joe Excel Discussion (Misc queries) 4 November 26th 04 03:49 PM
Open Another Workbook and Call Macro Bill Oertell[_2_] Excel Programming 1 January 20th 04 04:29 AM
Call Function From Different Workbook NQuinn Excel Programming 0 January 13th 04 06:33 PM


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