Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
BillCPA
 
Posts: n/a
Default File A and File B Together

I have an excel file, File B (with macros), that is run during a month to
collect data. I have another excel file, File A (with macros), that runs at
month end. File A opens File B and works with the data in File B.

I need a way for the macros in File B to know whether it is running on its
own or whether it has been opened by File A. The 'Public' statement Help
says "variables declared using the Public statement are available to all
procedures in all modules in all applications", but File B doesn't seem to
pick up on a Public variable I have in File A.

I have also tried having File B check to see if File A is open, but that
always seems to come back true, even when File B is opened on its own.

Any ideas would be appreciated.

--
Bill @ UAMS
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default File A and File B Together

If its a case of one or two books open, use:

MsgBox Application.Workbooks.Count

--
Gary's Student


"BillCPA" wrote:

I have an excel file, File B (with macros), that is run during a month to
collect data. I have another excel file, File A (with macros), that runs at
month end. File A opens File B and works with the data in File B.

I need a way for the macros in File B to know whether it is running on its
own or whether it has been opened by File A. The 'Public' statement Help
says "variables declared using the Public statement are available to all
procedures in all modules in all applications", but File B doesn't seem to
pick up on a Public variable I have in File A.

I have also tried having File B check to see if File A is open, but that
always seems to come back true, even when File B is opened on its own.

Any ideas would be appreciated.

--
Bill @ UAMS

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
excel file lost Vivek Excel Discussion (Misc queries) 4 January 5th 06 05:08 AM
Copy File Automatically on Opening It Dolores Excel Discussion (Misc queries) 4 December 30th 05 07:12 PM
Pasword protected Excel file encrypted, how do I read this file? jonesteam Excel Discussion (Misc queries) 2 December 12th 05 06:32 PM
Links picking up values from an older version of linked file Cate Links and Linking in Excel 4 October 20th 05 01:53 PM
Opening a file with code without a set file name jenkinspat Excel Discussion (Misc queries) 1 March 3rd 05 03:40 PM


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