Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 25th, 2004, 11:59 PM
Registered User
Join Date: Mar 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Saving Excel workbook with new filename

I am trying to make a copy of the active workbook.
I used the command “ActiveWorkbook.SaveCopyAs strFileSaveAsName”
It makes a copy of the file… but the form from the original workbook, for some reason, gets moved to the newly created workbook. And when I try to run the original program one more time it gives me an error “could not find the specified object” and when I try to open the form in the original workbook I get “path/file access error” message.


Old May 21st, 2004, 01:55 PM
Authorized User
Join Date: May 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts

Here is some code:

        lcFileSaveAs = "c:\temp\" & lcFileSaveAs

        goExcel.ActiveWorkbook.Saved = True
        goExcel.ActiveWorkbook.SaveAs FileName:=lcFileSaveAs

Notice the := , yes the power of : learned it the hard way.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Inline Excel Output Filename Sir Guso ASP.NET 1.0 and 1.1 Professional 2 May 31st, 2007 08:26 PM
Display Excel Workbook in browser roopsk C++ Programming 0 August 8th, 2006 06:34 AM
Closing Excel Workbook rekha_jsr Excel VBA 0 July 9th, 2005 02:40 AM
EXCEL question saving a file saving the the first macupryk VS.NET 2002/2003 0 January 6th, 2005 05:33 PM
Save the Existing Workbook to Other Filename tks_muthu Excel VBA 1 November 29th, 2004 10:41 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.