473,394 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to reference my constants declared in an xl module

Good Evening

I am importing data from an excel application into access.My excel app
has important constants declared in one of its modules that relate to the
worksheet columns.I need to refer to these same constants from access . I
dont wish to combine both apps into 1 big app and I certainly dont wish to
declare them again in access as the excel constants declarations may change
periodically .

Any suggestions

Thanking you

Tony
Nov 12 '05 #1
3 2257
On Fri, 31 Oct 2003 08:49:42 +1300, "Tony Miller"
<tc***************@xtra.co.nz> wrote:

I'm not an expert on this, but I think you can't reference global
constants. However, you *can* call a public function, so then the task
becomes to write a function in Excel like this:
Public Function GetGLobalVariable(byval strVariable as String) as
Variant
select case strVariable
case "MyFirstGlobalVariable"
GetGlobalVariable = MY_FIRST_GLOBAL_VAR
'etc
end select
end function

-Tom.

Good Evening

I am importing data from an excel application into access.My excel app
has important constants declared in one of its modules that relate to the
worksheet columns.I need to refer to these same constants from access . I
dont wish to combine both apps into 1 big app and I certainly dont wish to
declare them again in access as the excel constants declarations may change
periodically .

Any suggestions

Thanking you

Tony


Nov 12 '05 #2
Rather than import the Excel data, link to the Excel data. Excel will continue
to make use of the constants and if they change, the linked data that uses the
constants will automatically change accordingly.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
www.pcdatasheet.com
"Tony Miller" <tc***************@xtra.co.nz> wrote in message
news:rX******************@news.xtra.co.nz...
Good Evening

I am importing data from an excel application into access.My excel app
has important constants declared in one of its modules that relate to the
worksheet columns.I need to refer to these same constants from access . I
dont wish to combine both apps into 1 big app and I certainly dont wish to
declare them again in access as the excel constants declarations may change
periodically .

Any suggestions

Thanking you

Tony

Nov 12 '05 #3
Thanks Tom

The function works well.After looking around I found the run method will
call the function
I added the following lines in access to call the xl function

Set xlapp = GetObject(, "Excel.application")

x = xlapp.Run("MyWorkbook.xls!GetGlobalVariable", "myconststr")

"Tom van Stiphout" <to*****@no.spam.cox.net> wrote in message
news:2q********************************@4ax.com...
On Fri, 31 Oct 2003 08:49:42 +1300, "Tony Miller"
<tc***************@xtra.co.nz> wrote:

I'm not an expert on this, but I think you can't reference global
constants. However, you *can* call a public function, so then the task
becomes to write a function in Excel like this:
Public Function GetGLobalVariable(byval strVariable as String) as
Variant
select case strVariable
case "MyFirstGlobalVariable"
GetGlobalVariable = MY_FIRST_GLOBAL_VAR
'etc
end select
end function

-Tom.

Good Evening

I am importing data from an excel application into access.My excel apphas important constants declared in one of its modules that relate to the
worksheet columns.I need to refer to these same constants from access . I
dont wish to combine both apps into 1 big app and I certainly dont wish todeclare them again in access as the excel constants declarations may changeperiodically .

Any suggestions

Thanking you

Tony

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Raymond Hettinger | last post by:
Comments are invited on the following proposed PEP. Raymond Hettinger ------------------------------------------------------- PEP: 329
11
by: Bill Nguyen | last post by:
I need to make a set of constants to be available for the whole application. Public const is confined to the form from which constants are declared. Is there a way to declare once and all forms can...
20
by: MartinRinehart | last post by:
Is the following correct? x = "some string" x is a reference to "some string" foo(x) Reference is passed to function.
54
by: shuisheng | last post by:
Dear All, I am always confused in using constants in multiple files. For global constants, I got some clues from http://msdn.microsoft.com/en-us/library/0d45ty2d(VS.80).aspx So in header...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.