ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to Reference Global Variable for external application. (https://www.excelbanter.com/excel-programming/305249-how-reference-global-variable-external-application.html)

ajcross123

How to Reference Global Variable for external application.
 
I have two workbooks. I want workbook A to set global module variables
in workbook B and direct B by calling its subroutines.

Currently, workbook B sets the global variables with its Forms. The
routines read the data files using the global variables.

Andy Cross


---
Message posted from http://www.ExcelForum.com/


Tom Ogilvy

How to Reference Global Variable for external application.
 
create a reference in Workbook A to workbook B.

--
Regards,
Tom Ogilvy

"ajcross123 " wrote in message
...
I have two workbooks. I want workbook A to set global module variables
in workbook B and direct B by calling its subroutines.

Currently, workbook B sets the global variables with its Forms. The
routines read the data files using the global variables.

Andy Cross


---
Message posted from http://www.ExcelForum.com/




ajcross123[_2_]

How to Reference Global Variable for external application.
 
Tom Ogilvy wrote:
[b]create a reference in Workbook A to workbook B.

--
Regards,
Tom Ogilvy


huh?!? how do I do that?

In VBA, I see this
VBAProject (WorkbookA)
+Microsoft Excel Objects
+Modules
+Module1
VBAProject (WorkbookB)
+Microsoft Excel Objects
+Modules
+Module2

In Module2 has this global and this routine:
Public filename As String

Public Sub importFile
Dim f as File

End Su

--
Message posted from http://www.ExcelForum.com


Myrna Larson

How to Reference Global Variable for external application.
 
In the VB Editor, go to the Tools menu, select References, and put a check
mark in front of the 2nd workbook (I believe it has to be open at this point).


On Thu, 29 Jul 2004 12:40:11 -0500, ajcross123
wrote:

Tom Ogilvy wrote:
[b]create a reference in Workbook A to workbook B.

--
Regards,
Tom Ogilvy


huh?!? how do I do that?

In VBA, I see this
VBAProject (WorkbookA)
+Microsoft Excel Objects
+Modules
+Module1
VBAProject (WorkbookB)
+Microsoft Excel Objects
+Modules
+Module2

In Module2 has this global and this routine:
Public filename As String

Public Sub importFile
Dim f as File

End Sub


---
Message posted from http://www.ExcelForum.com/



ajcross123[_3_]

How to Reference Global Variable for external application.
 
Hmm, now I am not getting by this error which doesn't give me a clue a
to what is conflicting:

Name conflicts with existing module, project or object library.

I tried renaming obvious conflicts. All that I can think of is tha
both have "ThisWorkbook".

On a different tack, I added routines to the other sheet. These ar
executed with Application.Run and these can set that workbook'
variables and call its subroutines.

Thank you, though.

Myrna Larson wrote:
In the VB Editor, go to the Tools menu, select References, and put
check
mark in front of the 2nd workbook (I believe it has to be open a
this point)


--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 05:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com