Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default adding a form to a VBA project

Hi,

I need to add a form to multiple workbooks.

I have the form saved on a network drive and I need to build a workbook to
email out users so they can click a button and it will run code to add a form
to their open workbooks. Is this possible?

Thanks

Simon Shaw
www.kode101.com


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default adding a form to a VBA project

You want to add a form to every open workbook on your users' computers? What
if the workbook they are currently using has nothing to do with your form?
If you wrote code that tried to add VB components to workbooks on my
computer, it would be the last code of yours I'd ever run.

Write an add-in that contains and controls the form, make it accessible from
every relevant workbook, then distribute it so the users install it as an
add-in.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Simon Shaw" <simonATsimonstoolsDOTcom wrote in message
...
Hi,

I need to add a form to multiple workbooks.

I have the form saved on a network drive and I need to build a workbook to
email out users so they can click a button and it will run code to add a
form
to their open workbooks. Is this possible?

Thanks

Simon Shaw
www.kode101.com




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default adding a form to a VBA project

You can incorporate the following into your code. Its possible to run this
on workbook open, if you prefer.

ActiveWorkbook.VBProject.VBComponents.Import "C:\Documents and Settings\..."
' whatever your path directory is on your network drive.

hope this helps!
-chad

"Jon Peltier" wrote:

You want to add a form to every open workbook on your users' computers? What
if the workbook they are currently using has nothing to do with your form?
If you wrote code that tried to add VB components to workbooks on my
computer, it would be the last code of yours I'd ever run.

Write an add-in that contains and controls the form, make it accessible from
every relevant workbook, then distribute it so the users install it as an
add-in.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Simon Shaw" <simonATsimonstoolsDOTcom wrote in message
...
Hi,

I need to add a form to multiple workbooks.

I have the form saved on a network drive and I need to build a workbook to
email out users so they can click a button and it will run code to add a
form
to their open workbooks. Is this possible?

Thanks

Simon Shaw
www.kode101.com





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default adding a form to a VBA project

obviously I would validate that the open workbook is one that I want to add a
form to... I am by no means a reckless programer!

--
Simon Shaw, CA
President
Kode101 Inc.
www.kode101.com


"Jon Peltier" wrote:

You want to add a form to every open workbook on your users' computers? What
if the workbook they are currently using has nothing to do with your form?
If you wrote code that tried to add VB components to workbooks on my
computer, it would be the last code of yours I'd ever run.

Write an add-in that contains and controls the form, make it accessible from
every relevant workbook, then distribute it so the users install it as an
add-in.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Simon Shaw" <simonATsimonstoolsDOTcom wrote in message
...
Hi,

I need to add a form to multiple workbooks.

I have the form saved on a network drive and I need to build a workbook to
email out users so they can click a button and it will run code to add a
form
to their open workbooks. Is this possible?

Thanks

Simon Shaw
www.kode101.com





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default adding a form to a VBA project

Yes, but the approach is still cumbersome. What if the form changes? You
would have to replace it in every workbook. If it's in an add-in, you can
replace the entire add-in and leave the data files alone, which is easier
than tracking down all the files that need to be changed.

One way to program more effectively is to separate parts of the system. Keep
the data (workbooks) separate from the logic (the add-in). This way, you
don't risk losing tons of data to adjust the code.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Simon Shaw" <simon AT kode101 DOT com wrote in message
...
obviously I would validate that the open workbook is one that I want to
add a
form to... I am by no means a reckless programer!

--
Simon Shaw, CA
President
Kode101 Inc.
www.kode101.com


"Jon Peltier" wrote:

You want to add a form to every open workbook on your users' computers?
What
if the workbook they are currently using has nothing to do with your
form?
If you wrote code that tried to add VB components to workbooks on my
computer, it would be the last code of yours I'd ever run.

Write an add-in that contains and controls the form, make it accessible
from
every relevant workbook, then distribute it so the users install it as an
add-in.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Simon Shaw" <simonATsimonstoolsDOTcom wrote in message
...
Hi,

I need to add a form to multiple workbooks.

I have the form saved on a network drive and I need to build a workbook
to
email out users so they can click a button and it will run code to add
a
form
to their open workbooks. Is this possible?

Thanks

Simon Shaw
www.kode101.com









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default adding a form to a VBA project

good point. I do normally setup my projects as such. however, this one was a
patch for something very old.

--
Simon Shaw, CA
President
Kode101 Inc.
www.kode101.com


"Jon Peltier" wrote:

Yes, but the approach is still cumbersome. What if the form changes? You
would have to replace it in every workbook. If it's in an add-in, you can
replace the entire add-in and leave the data files alone, which is easier
than tracking down all the files that need to be changed.

One way to program more effectively is to separate parts of the system. Keep
the data (workbooks) separate from the logic (the add-in). This way, you
don't risk losing tons of data to adjust the code.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Simon Shaw" <simon AT kode101 DOT com wrote in message
...
obviously I would validate that the open workbook is one that I want to
add a
form to... I am by no means a reckless programer!

--
Simon Shaw, CA
President
Kode101 Inc.
www.kode101.com


"Jon Peltier" wrote:

You want to add a form to every open workbook on your users' computers?
What
if the workbook they are currently using has nothing to do with your
form?
If you wrote code that tried to add VB components to workbooks on my
computer, it would be the last code of yours I'd ever run.

Write an add-in that contains and controls the form, make it accessible
from
every relevant workbook, then distribute it so the users install it as an
add-in.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Simon Shaw" <simonATsimonstoolsDOTcom wrote in message
...
Hi,

I need to add a form to multiple workbooks.

I have the form saved on a network drive and I need to build a workbook
to
email out users so they can click a button and it will run code to add
a
form
to their open workbooks. Is this possible?

Thanks

Simon Shaw
www.kode101.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
Adding Checkboxes to a Form Bill[_30_] Excel Programming 3 June 26th 06 11:57 PM
Loading a calendar (user form) from another project (personal.xls) Ollie[_2_] Excel Programming 1 September 25th 05 09:33 PM
adding reference "can't find project or library" yule1111 Excel Programming 1 July 18th 04 03:22 PM
"Can't find Project or Libr." when using Form in Macro Cae Excel Programming 4 May 19th 04 10:33 PM
Adding a toolbar on a form John Riley Excel Programming 1 February 20th 04 09:09 PM


All times are GMT +1. The time now is 01:38 AM.

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"