Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

Need help with copy/pasting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rut - 14 Mar 2005 20:25 GMT
I'm trying to copy the active sheet in an open workbook to a new
workbook and save it. Below code is used:

name = ActiveSheet.name
path = "C:\"

Set fmWkBook = Application.ActiveWorkbook
fmWkBook.Worksheets(ActiveSheet.name).Copy

Set toWkBook = Application.ActiveWorkbook
With toWkBook
   .SaveLinkValues = False
   .UpdateRemoteReferences = False
   ' Save the Workbook
   .SaveAs FileName:=path & name, FileFormat:=xlNormal
   .Close
End With
Set toWkBook = Nothing

I have two problems.

1. It always asks "Save Book1 with references to unsaved documents?"

2. It doesn't always get the active sheet (ie. the sheet showing on the
screen). It sometime gets a sheet on another tab.

I'm using Excel 2000.

Thanks
Rut
Jonathan West - 15 Mar 2005 12:45 GMT
Hi Rut,

This group deals with VBA in Word. The experts on Excel VBA are in the
microsoft.public.excel.programming group. You'll have more chance of getting
an informed reply if you re-post there.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

> I'm trying to copy the active sheet in an open workbook to a new
> workbook and save it. Below code is used:
[quoted text clipped - 26 lines]
> Thanks
> Rut
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.