Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Declaring variables - Option Explicit

Hi,

I have a problem which I hope someone can explain to me. An excel fil
with a lot of macro's in it uses no "clean" declaration of variables
so not Dim i As Integer i=1, but just i=1), so every parameter i
declared as Variable. On my computer this file works with out
problem, on other computers the file gives an error message "canno
find Library".

I know this has someting to do with option explicit, but my question i
how can I let the file work on the other computers without declaring al
the variables for the macro's (which will take me a couple of days)

Thanks in advance

maarte

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Declaring variables - Option Explicit

Bijl167 wrote:

Hi,

I have a problem which I hope someone can explain to me. An excel file
with a lot of macro's in it uses no "clean" declaration of variables (
so not Dim i As Integer i=1, but just i=1), so every parameter is
declared as Variable. On my computer this file works with out a
problem, on other computers the file gives an error message "cannot
find Library".

I know this has someting to do with option explicit, but my question
is how can I let the file work on the other computers without
declaring all the variables for the macro's (which will take me a
couple of days)

Thanks in advance

maarten


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


Maarten,

So what you want is not to fix your bad coding style, but how to make
it even worse? The first rule of Excel/VBA debugging should always be:
declare correctly!
See here why and how:
http://www.cpearson.com/excel/DeclaringVariables.htm
http://www.cpearson.com/excel/variables.htm

As soon as you have declared everything, try again. If it still does
not work, come back here and we'll try to help you.

--
Amedee Van Gasse using XanaNews 1.16.3.1
If it has an "X" in the name, it must be Linux?
Please don't thank me in advance. Thank me afterwards if it works or
hit me in the face if it doesn't. ;-)

PS: I found 2 small shortcomings on www.excelforum.com:
1. You do *not* have to pay for access to news:msnews.microsoft.com
2. A *real* newsreader (not Outlook Express) is actually very easy to
use. See www.newsreaders.com for more info.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Declaring variables - Option Explicit

Maarten,

Check whether the other computer has missing links. In VBE, got to
ToolsReferences, and if any say Missing, uncheck them.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Bijl167 " wrote in message
...
Hi,

I have a problem which I hope someone can explain to me. An excel file
with a lot of macro's in it uses no "clean" declaration of variables (
so not Dim i As Integer i=1, but just i=1), so every parameter is
declared as Variable. On my computer this file works with out a
problem, on other computers the file gives an error message "cannot
find Library".

I know this has someting to do with option explicit, but my question is
how can I let the file work on the other computers without declaring all
the variables for the macro's (which will take me a couple of days)

Thanks in advance

maarten


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



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
Option Explicit [email protected] Excel Discussion (Misc queries) 5 April 30th 08 11:19 PM
option explicit Dave F Excel Discussion (Misc queries) 2 September 5th 06 02:46 PM
Option Explicit Grace[_4_] Excel Programming 6 June 12th 04 04:28 PM
Option Explicit Error Bob[_44_] Excel Programming 3 December 31st 03 08:16 AM
Implied Option Explicit in XP?? Trip[_2_] Excel Programming 3 November 13th 03 12:24 AM


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