Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I access a "Global Variable" of one Workbook from another??

I tried

local_Var = [Book2.xls]gb_To_Be_Read_From_Outside

from Book1.xls

I know it looks stupid, but need some way to do it, please help.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default How do I access a "Global Variable" of one Workbook from another??

in the book with the variable, in a general module (in this case, Book2.xls)

Public MVar as Variant

' Place holder
sub InitMyVar()
MyVar = int(rnd()*1000+1)
End Sub

Function ReturnMyVar()
ReturnMyVar = Myvar
End function

Myvar should be initialized or assigned a value some how - assume that is
taken care off

To get the value,

localVar = Application.Run("Book2.xls!ReturnMyVar")

--
Regards,
Tom Ogilvy


" wrote:

I tried

local_Var = [Book2.xls]gb_To_Be_Read_From_Outside

from Book1.xls

I know it looks stupid, but need some way to do it, please help.


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
How do I access the printer variable "number of copies"? Hemetman Excel Worksheet Functions 1 September 29th 09 05:19 AM
How do I stop "global" hyperlinks changing to "local" links? Em Excel Worksheet Functions 2 August 26th 08 01:18 PM
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" Luc[_3_] Excel Programming 2 September 28th 05 08:37 PM
VBA code to create "variable" worksheets within a workbook Chris Excel Programming 1 September 14th 05 02:08 AM
Urgently need VB Help - Declaring "Global" Variable? April Excel Programming 1 February 18th 05 02:02 AM


All times are GMT +1. The time now is 11:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"