Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 25th, 2004, 11:59 PM
Registered User
 
Join Date: Mar 2004
Location: Boston, , USA.
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.

Thanks.


Reply With Quote
  #2 (permalink)  
Old May 21st, 2004, 01:55 PM
Authorized User
 
Join Date: May 2004
Location: Irving, TX, USA.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is some code:

        lcFileSaveAs = "c:\temp\" & lcFileSaveAs

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


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



Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:15 PM.


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