LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Copy VB Project

With the project protected, you'll have to use some SendKeys to unprotect the
project. And in newer versions of excel, each user can choose whether they want
to allow program access to their projects.

I think I'd use a template workbook that contains all the code that I need.
Then use that to put the data.

Option Explicit
Sub OpenTemplate()

Dim myTemplateName As String
Dim tempStr As String
Dim wkbk As Workbook

myTemplateName = "\\commonshare\foldername\templatename.xlt"

tempStr = ""
On Error Resume Next
tempStr = Dir(myTemplateName)
On Error GoTo 0
If tempStr = "" Then
MsgBox "design error--Template not available"
Exit Sub
End If

Set wkbk = Workbooks.Add(template:=myTemplateName)

'do what you need...
End Sub

May help get you started.

Anson wrote:

Is it possible to copy the entire VB Project (with protection) to a new workbook? I am trying to write a program to allow users to produce an extract of the workbook with all the programming functions in it (without changing the original workbook). I want to extract it witout saving it (sort of like the "sheets.copy" code) unless the user saves it manually.


--

Dave Peterson

 
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
Excell error "Can't find Project or Library" Project VBAProject Lost in Excel Excel Worksheet Functions 0 April 12th 07 04:42 PM
project jorge Excel Worksheet Functions 0 March 28th 07 07:28 PM
How to convert MS Project to MS Excel. I don't have MS Project. Jane Excel Discussion (Misc queries) 1 February 20th 06 10:01 PM
How to copy VBA project? cubus Excel Worksheet Functions 7 January 25th 05 09:05 PM
Help with a project. Help me please. Jason Monette Excel Programming 1 October 23rd 03 02:20 PM


All times are GMT +1. The time now is 10:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"