Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel-VBA and FlexLM

Hi,

We intend to use FlexLM as out licensing system 'behind' Excel-VBA. FlexLM
is basically a bunch of dll's and a number of API calls.

The thing is that in my VBA code left, right and centre I use the "End"
statement (Yes, I know it is bad programming style - but it is kind of
inherited). The problem is that this End statement not only clears all the
VBA variables, but it seems to clear the FlexLM memory also!! Basically if,
upon closing my workbook, I pass the license key back to the dll (this
license key I temporarily store in a workbook name, so is *not* cleared by
the End statement), the dll falls over if an End statement has been
executed, whereas it happily accepts the license key if End is not executed.

Is there any way around this? (other then going through tens of thousands of
lines of code to get rid of the End statement). For instance, is there a way
to stop Excel execution without clearing the workspace (incidentally, "Stop"
doesn't do the job of course). Or is there a way of loading the FlexLM dll's
in such a way that they are unaffected by the End statement. Or maybe you
have anoather idea?

Look forward to your reply.

Cheers - Michel Kemper - London


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 968
Default Excel-VBA and FlexLM

Hi Michel,

I think its worse than that: using End not only kills your VBA variables, it
kills everyone else's object variables as well, including all Application
level events.

So many other Excel addins that have been loaded will probably crash.

So I suspect the only solution is to replace all the END statements.

Charles
______________________
Decision Models
The Excel Calculation Site
www.DecisionModels.com

"Michel Kemper" wrote in message
. ..
Hi,

We intend to use FlexLM as out licensing system 'behind' Excel-VBA. FlexLM
is basically a bunch of dll's and a number of API calls.

The thing is that in my VBA code left, right and centre I use the "End"
statement (Yes, I know it is bad programming style - but it is kind of
inherited). The problem is that this End statement not only clears all the
VBA variables, but it seems to clear the FlexLM memory also!! Basically

if,
upon closing my workbook, I pass the license key back to the dll (this
license key I temporarily store in a workbook name, so is *not* cleared by
the End statement), the dll falls over if an End statement has been
executed, whereas it happily accepts the license key if End is not

executed.

Is there any way around this? (other then going through tens of thousands

of
lines of code to get rid of the End statement). For instance, is there a

way
to stop Excel execution without clearing the workspace (incidentally,

"Stop"
doesn't do the job of course). Or is there a way of loading the FlexLM

dll's
in such a way that they are unaffected by the End statement. Or maybe you
have anoather idea?

Look forward to your reply.

Cheers - Michel Kemper - London




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel-VBA and FlexLM

Charles,

I suspected as much, ... but there is always hope, hence my question!

Two related questions:

1. Is 'End' the only statement that wipes the memory, or are there other
situations that cause the memory to be cleared?
2. I will have to search for 'End' throughout my code. The problem is that I
will find 10000's of 'End' strings a la 'End If' and 'End With' etc. Do you
know of a way to find only 'End' and not 'End If' etc?

Cheers - Michel.



"Charles Williams" wrote in message
...
Hi Michel,

I think its worse than that: using End not only kills your VBA variables,

it
kills everyone else's object variables as well, including all Application
level events.

So many other Excel addins that have been loaded will probably crash.

So I suspect the only solution is to replace all the END statements.

Charles
______________________
Decision Models
The Excel Calculation Site
www.DecisionModels.com

"Michel Kemper" wrote in message
. ..
Hi,

We intend to use FlexLM as out licensing system 'behind' Excel-VBA.

FlexLM
is basically a bunch of dll's and a number of API calls.

The thing is that in my VBA code left, right and centre I use the "End"
statement (Yes, I know it is bad programming style - but it is kind of
inherited). The problem is that this End statement not only clears all

the
VBA variables, but it seems to clear the FlexLM memory also!! Basically

if,
upon closing my workbook, I pass the license key back to the dll (this
license key I temporarily store in a workbook name, so is *not* cleared

by
the End statement), the dll falls over if an End statement has been
executed, whereas it happily accepts the license key if End is not

executed.

Is there any way around this? (other then going through tens of

thousands
of
lines of code to get rid of the End statement). For instance, is there a

way
to stop Excel execution without clearing the workspace (incidentally,

"Stop"
doesn't do the job of course). Or is there a way of loading the FlexLM

dll's
in such a way that they are unaffected by the End statement. Or maybe

you
have anoather idea?

Look forward to your reply.

Cheers - Michel Kemper - London






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 968
Default Excel-VBA and FlexLM

Hi Michel,

AFAIK its the only statement, but anything that resets the VB environment
will also do it (ie changing code in debug).

I am sure you could easily write a routine using the VBE object model to
scan for END and ignore END IF etc: but there are a lot of people who are
cleverer than me at programming the VBE.

If you want to go that route look at Rob Bovey's response to a post of mine
earlier today, and also check out Chip pearson's site on manipulating the
VBE. And stephen Bullen has an excellent chapter in Excel 2002 programmers
reference.


hth
Charles
______________________
Decision Models
The Excel Calculation Site
www.DecisionModels.com

"Michel Kemper" wrote in message
...
Charles,

I suspected as much, ... but there is always hope, hence my question!

Two related questions:

1. Is 'End' the only statement that wipes the memory, or are there other
situations that cause the memory to be cleared?
2. I will have to search for 'End' throughout my code. The problem is that

I
will find 10000's of 'End' strings a la 'End If' and 'End With' etc. Do

you
know of a way to find only 'End' and not 'End If' etc?

Cheers - Michel.



"Charles Williams" wrote in message
...
Hi Michel,

I think its worse than that: using End not only kills your VBA

variables,
it
kills everyone else's object variables as well, including all

Application
level events.

So many other Excel addins that have been loaded will probably crash.

So I suspect the only solution is to replace all the END statements.

Charles
______________________
Decision Models
The Excel Calculation Site
www.DecisionModels.com

"Michel Kemper" wrote in message
. ..
Hi,

We intend to use FlexLM as out licensing system 'behind' Excel-VBA.

FlexLM
is basically a bunch of dll's and a number of API calls.

The thing is that in my VBA code left, right and centre I use the

"End"
statement (Yes, I know it is bad programming style - but it is kind of
inherited). The problem is that this End statement not only clears all

the
VBA variables, but it seems to clear the FlexLM memory also!!

Basically
if,
upon closing my workbook, I pass the license key back to the dll (this
license key I temporarily store in a workbook name, so is *not*

cleared
by
the End statement), the dll falls over if an End statement has been
executed, whereas it happily accepts the license key if End is not

executed.

Is there any way around this? (other then going through tens of

thousands
of
lines of code to get rid of the End statement). For instance, is there

a
way
to stop Excel execution without clearing the workspace (incidentally,

"Stop"
doesn't do the job of course). Or is there a way of loading the FlexLM

dll's
in such a way that they are unaffected by the End statement. Or maybe

you
have anoather idea?

Look forward to your reply.

Cheers - Michel Kemper - London








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



All times are GMT +1. The time now is 06:45 PM.

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"