Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Updating VBA Modules and Forms in User Workbooks

Hi

Have found this code through the newsgroup, that appeared to achieve what I
want to do:

Sub CopyAllModules()

Dim FName As String
Dim VBComp As VBIDE.VBComponent

With Workbooks("one.xls")
FName = .Path & "\code.txt"
If Dir(FName) < "" Then
Kill FName
End If
For Each VBComp In .VBProject.VBComponents
If VBComp.Type < vbext_ct_Document Then
VBComp.Export FName
Workbooks("Two.xls").VBProject.VBComponents.import FName ' **
Kill FName
End If
Next VBComp
End With

End Sub

However it crashes on the import line (**). It seems that this code will
only export/import the modules which can be converted to text files. I need
to update user spreadsheets with both modules and FORMS. What additions to
this code do I need. VBA help is less than useful with regard to working
with project elements. ( I am referencing "Microsoft Visual Basic for
Application Extensibility 5.3")

Any help here gratefully received.

Joe90

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
using forms and modules in multiple workbooks scrabtree23[_2_] Excel Programming 1 November 11th 03 10:57 PM
Forms and Modules scrabtree23[_2_] Excel Programming 4 November 11th 03 03:57 PM
Modules and Forms II Pedro Excel Programming 1 November 7th 03 11:19 AM
Modules and Forms Pedro Excel Programming 2 November 6th 03 02:02 PM
Need help on How to programatically Import VBA Project Excel Objects, Forms, Modules JMMach Excel Programming 7 October 21st 03 08:46 PM


All times are GMT +1. The time now is 09:08 PM.

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"