Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

How do you change code in the VBE without opening the target workb

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brett Smith - 19 Jan 2006 20:26 GMT
I am wondering if there is a way of changing the code in the VBE for other
Excel files while the target Excel file is already closed.  Is this possible?
How would I code this?
Norman Jones - 19 Jan 2006 20:35 GMT
Hi Brett,

See Chip Pearson's page on programming to the VBE at:

       http://www.cpearson.com/excel/vbe.htm

---
Regards,
Norman

>I am wondering if there is a way of changing the code in the VBE for other
> Excel files while the target Excel file is already closed.  Is this
> possible?
> How would I code this?
Brett Smith - 19 Jan 2006 20:58 GMT
Know about that already, that didn't really help much.  Can you expand?  
Thanks!

> Hi Brett,
>
[quoted text clipped - 10 lines]
> > possible?
> > How would I code this?
Norman Jones - 19 Jan 2006 21:06 GMT
Hi Brett,

Chip Pearson shows how to write or delete code in an external project.
However, I think that the other workbook would have to be open - I missed
the 'closed' stipulation.

---
Regards,
Norman

> Know about that already, that didn't really help much.  Can you expand?
> Thanks!
[quoted text clipped - 14 lines]
>> > possible?
>> > How would I code this?
Tushar Mehta - 19 Jan 2006 22:10 GMT
You should consider writing code so that it doesn't need replacement at the
source code level.  An add-in would be one way to go.  From an earlier post
of mine...

I've been meaning to write a tutorial on the subject. Just haven't
gotten around to it. In the meantime, check msdn.microsoft.com.
Specifically,
Microsoft Office XP Developer
Building Application-Specific Add-ins
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/modcore/html/deovrbuildingapplicationspecificaddins.asp
and
Microsoft Office XP Developer
Add-ins, Templates, Wizards, and Libraries
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/modcore/html/deovraddinstemplateswizardslibraries.asp.

Concentrate on the 'Application specific add-ins' and not the 'COM Add-
Ins.'

Basically, in XL, after saving the workbook with the code, save it as
an add-in (File | Save As...) Close the file, then load the add-in
through Tools |Add-Ins...

A key point to remember is that code in the add-in that refers to
ThisWorkbook refers to the add-in workbook, while a reference to
ActiveWorkbook refers to the open workbook, whatever that might be.

***** Please make very very sure you always save the file as a normal
workbook before saving it as an add-in. Otherwise, you may be unable to
access the worksheets / source in the add-in file! *****

Signature

Regards,

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

> I am wondering if there is a way of changing the code in the VBE for other
> Excel files while the target Excel file is already closed.  Is this possible?
>  How would I code this?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.