View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Richard[_7_] Richard[_7_] is offline
external usenet poster
 
Posts: 13
Default Module / Sub as string

can you recommend a book which will help me learn how to use the vba interface.
I am (very) slowly getting my head around the vba concepts, but feel that
knowing how to use the object explorer, debug tools etc would reduce the
amount so questions I have to ask.

I guess this is an issue for lots of (so called) self taught coders.

"Gary''s Student" wrote:

A very useful tip.
--
Gary''s Student - gsnu200791


"Richard" wrote:

Harald

I got it,

Dim ClientName As String

ClientName = Application.VBE.ActiveCodePane.CodeModule.Name

This enables me to give each module the client name, which in turn allows me
to use the ClientName string as part of the file path. No need to search
through and make code changes for each new client and the sub name can be
whatever I like, which is handy as in some cases I have more than 1 sub for
the same client.

Richard


"Harald Staff" wrote:

Hi R

Afaik no, sorry. It would make error handling far easier if it was.

Best wishes Harald


"Richard" skrev i melding
...
Hi

Is it possible to read either the module and/or the sub name and use it as
a
string within the code?

R