Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default How to open a workbook as a copy?

Excel 2003

Sorry, I'm drawing a blank. I just want VBA to open an existing xls as
a copy. The user will then save it where it needs to go.

Example path and file:
c:\shared files\projects\mccoy.xls

Another scenario is if it's a template file:
c:\shared files\projects\mccoy.xlt

Thanks,
Chuck

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default How to open a workbook as a copy?


sName = "c:\shared files\projects\mccoy.xls"
workbooks.open sName, ReadOnly:=True

--
Regards,
Tom Ogilvy

"c mateland" wrote:

Excel 2003

Sorry, I'm drawing a blank. I just want VBA to open an existing xls as
a copy. The user will then save it where it needs to go.

Example path and file:
c:\shared files\projects\mccoy.xls

Another scenario is if it's a template file:
c:\shared files\projects\mccoy.xlt

Thanks,
Chuck


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default How to open a workbook as a copy?

That was it! I couldn't remember the strategy on doing it.

Thanks a bunch!

-Chuck

On Mar 15, 12:44 pm, Tom Ogilvy
wrote:
sName = "c:\shared files\projects\mccoy.xls"
workbooks.open sName, ReadOnly:=True

--
Regards,
Tom Ogilvy



"c mateland" wrote:
Excel 2003


Sorry, I'm drawing a blank. I just want VBA to open an existing xls as
a copy. The user will then save it where it needs to go.


Example path and file:
c:\shared files\projects\mccoy.xls


Another scenario is if it's a template file:
c:\shared files\projects\mccoy.xlt



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default How to open a workbook as a copy?

if you want to open the orginal template for editing to be saved with another
name but still as a template, then add

Editable:=True

as well. Of course the User would have to choose to save it as a template I
believe.

--
Regards,
Tom Ogilvy


"c mateland" wrote:

That was it! I couldn't remember the strategy on doing it.

Thanks a bunch!

-Chuck

On Mar 15, 12:44 pm, Tom Ogilvy
wrote:
sName = "c:\shared files\projects\mccoy.xls"
workbooks.open sName, ReadOnly:=True

--
Regards,
Tom Ogilvy



"c mateland" wrote:
Excel 2003


Sorry, I'm drawing a blank. I just want VBA to open an existing xls as
a copy. The user will then save it where it needs to go.


Example path and file:
c:\shared files\projects\mccoy.xls


Another scenario is if it's a template file:
c:\shared files\projects\mccoy.xlt




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to open a workbook as a copy?

Maybe you could open it as a readonly document:

Dim wkbk As Workbook
Set wkbk = Workbooks.Open(Filename:="book1.xls", ReadOnly:=True)

Or open it as a template:

Dim wkbk As Workbook
Set wkbk = Workbooks.Add(template:="book1.xls")

I would think that each would keep the original safe.

c mateland wrote:

Excel 2003

Sorry, I'm drawing a blank. I just want VBA to open an existing xls as
a copy. The user will then save it where it needs to go.

Example path and file:
c:\shared files\projects\mccoy.xls

Another scenario is if it's a template file:
c:\shared files\projects\mccoy.xlt

Thanks,
Chuck


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to open a workbook as a copy?

"or open as a template" should have been phrased "or create a new workbook using
the existing file as a template".

Dave Peterson wrote:

Maybe you could open it as a readonly document:

Dim wkbk As Workbook
Set wkbk = Workbooks.Open(Filename:="book1.xls", ReadOnly:=True)

Or open it as a template:

Dim wkbk As Workbook
Set wkbk = Workbooks.Add(template:="book1.xls")

I would think that each would keep the original safe.

c mateland wrote:

Excel 2003

Sorry, I'm drawing a blank. I just want VBA to open an existing xls as
a copy. The user will then save it where it needs to go.

Example path and file:
c:\shared files\projects\mccoy.xls

Another scenario is if it's a template file:
c:\shared files\projects\mccoy.xlt

Thanks,
Chuck


--

Dave Peterson


--

Dave Peterson
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
Copy Worksheet from one open workbook to another... sopranoiam Excel Worksheet Functions 0 August 17th 07 05:12 PM
Copy Values From A Non-Open Workbook? Jeffrey_Chcgo Excel Programming 3 March 26th 06 11:58 PM
Copy Values From A Non-Open Workbook Jeffrey_Chcgo[_2_] Excel Programming 2 March 25th 06 04:19 PM
copy row to another open workbook Bill Excel Programming 1 August 15th 05 07:26 PM
Does Workbook need to be open to copy to..from vba Dale[_15_] Excel Programming 1 December 11th 04 05:31 PM


All times are GMT +1. The time now is 10:23 PM.

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"