PC Review


Reply
Thread Tools Rate Thread

adding a form to a VBA project

 
 
=?Utf-8?B?U2ltb24gU2hhdw==?=
Guest
Posts: n/a
 
      1st Mar 2007
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 With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      1st Mar 2007
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
news:C3BF78F2-23D7-47B0-A7D9-(E-Mail Removed)...
> 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 With Quote
 
=?Utf-8?B?Q2hhZA==?=
Guest
Posts: n/a
 
      1st Mar 2007
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
> news:C3BF78F2-23D7-47B0-A7D9-(E-Mail Removed)...
> > 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 With Quote
 
=?Utf-8?B?U2ltb24gU2hhdw==?=
Guest
Posts: n/a
 
      5th Mar 2007
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
> news:C3BF78F2-23D7-47B0-A7D9-(E-Mail Removed)...
> > 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 With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      6th Mar 2007
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
news:02159FF6-B85D-43FC-9F33-(E-Mail Removed)...
> 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
>> news:C3BF78F2-23D7-47B0-A7D9-(E-Mail Removed)...
>> > 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 With Quote
 
=?Utf-8?B?U2ltb24gU2hhdw==?=
Guest
Posts: n/a
 
      15th Mar 2007
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
> news:02159FF6-B85D-43FC-9F33-(E-Mail Removed)...
> > 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
> >> news:C3BF78F2-23D7-47B0-A7D9-(E-Mail Removed)...
> >> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding an existing form to a project barcrofter Microsoft VB .NET 2 16th Dec 2008 05:12 PM
CF components adding desktop references to project when dropped onto form Stephen Inkpen Microsoft Dot NET Compact Framework 0 21st Jun 2004 01:43 AM
Adding a form and service to console app project. Clifton Griffin Microsoft C# .NET 1 31st May 2004 06:51 PM
Adding an existing form to a project Steve McLellan Microsoft VC .NET 2 19th May 2004 10:32 PM
Problem adding new form to existing project Mark Edwards Microsoft Dot NET Framework Forms 4 17th Dec 2003 05:57 PM


Features
 

Advertising
 

Newsgroups
 


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