User function

K

Karen

I'm using a lot of VBA in an Access app and find that in the VBA environment I'm consistently adding lines to every procedure to handle error checking. The only difference from procedure to procedure is the name of the procedure. I'd like to create a function that I could use in my VBA environment just to make my life simpler.

I'm pretty sure I can figure out the function but where exactly could I place it so that it is available every time I open the VBA editor. And........if the foregoing is possible, can I somehow assign it to a button that I could put on my VBA editor toolbar?

Karen Hagerman
University of Phoenix

Practitioner Faculty

(e-mail address removed)
 
W

Wei-Dong Xu [MSFT]

Hi Karen,

So far as I know, you can develop one com add-in for VBA editor to enhance the code editting. After the installation of "Office developer", you can
create one directly in the vba editor of office. Visaul Basic has the add-in template for the com add-in development which may help you some on this
scenario. There is one MSDN article for this issue. Please go to:
Walkthrough: Creating a COM Add-in with VBA
http://msdn.microsoft.com/library/d...re/html/dewlkwalkthroughcreatingcomadd-in.asp

There is also one article for creating the com add-in using VB6.0. Please go to:
Building a COM Add-in for Microsoft Office XP Using Microsoft Visual Basic 6.0
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_comaddinvb6.asp

Furthermore, you can obtain more information about the office developer from the link. Please go to:
Microsoft Office XP Developer
http://msdn.microsoft.com/library/e...riMicrosoftOffice2002Developer.asp?frame=true

In addition, I'd also suggest you can use some 3rd party copy-paste tools to store some general function codes for the project. During your
development, you can copy-paste these general codes very quickly with the help of these tools.

Please feel free to let me know if you have any further questions.

Does this answer your question? Thank you for using Microsoft NewsGroup!

Wei-Dong Xu
Microsoft Product Support Services
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
T

Tushar Mehta

From the documentation I've read it is somewhat more messy modifying
the VBE environment than that of an Office app. However, it cannot
possibly be all that difficult.

There must be many examples of VB(A) programmers customizing their VBE,
but the only leads I'm aware of are Stephen Bullen's
http://www.bmsltd.co.uk/excel/SBXLPage.asp#VBA
and Chip Pearson's http://www.cpearson.com/excel/vbe.htm and
http://www.cpearson.com/excel/vbemenus.htm

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
K

Karen

Hi Wei-Dong,

I will have to process this but it looks like it will do the trick, thanks
so much.

Karen

Wei-Dong Xu said:
Hi Karen,

So far as I know, you can develop one com add-in for VBA editor to enhance
the code editting. After the installation of "Office developer", you can
create one directly in the vba editor of office. Visaul Basic has the
add-in template for the com add-in development which may help you some on
this
scenario. There is one MSDN article for this issue. Please go to:
Walkthrough: Creating a COM Add-in with VBA
http://msdn.microsoft.com/library/d...re/html/dewlkwalkthroughcreatingcomadd-in.asp

There is also one article for creating the com add-in using VB6.0. Please go to:
Building a COM Add-in for Microsoft Office XP Using Microsoft Visual Basic 6.0
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_comaddinvb6.asp

Furthermore, you can obtain more information about the office developer from the link. Please go to:
Microsoft Office XP Developer
http://msdn.microsoft.com/library/e...riMicrosoftOffice2002Developer.asp?frame=true

In addition, I'd also suggest you can use some 3rd party copy-paste tools
to store some general function codes for the project. During your
 
S

Stephen Bullen

Hi Karen,
I'm using a lot of VBA in an Access app and find that in the VBA
environment I'm consistently adding lines to every procedure to
handle error checking. The only difference from procedure to
procedure is the name of the procedure. I'd like to create a
function that I could use in my VBA environment just to make my life
simpler.

I'm pretty sure I can figure out the function but
where exactly could I place it so that it is available every time I
open the VBA editor. And........if the foregoing is possible, can I
somehow assign it to a button that I could put on my VBA editor
toolbar?

One of the must-have tools for VBA development is the mztools addin
(www.mztools.com), which includes such a utility.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.co.uk
 
W

Wei-Dong Xu [MSFT]

Hi Karen,

Thank you for replying!

You are very welcome!

Please feel free to let me know if you have any questions.

Thank you once more for using Microsoft NewsGroup!

Wei-Dong Xu
Microsoft Product Support Services
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top