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: 1
Default Problem with compiling this VBA - help please


Hi all, we have this VBA from Ron deBruins website, when we try t
compile it brings back the error message "compile error Ccan't fin
Project or Library".
What reference do I need to include to make this work ?
We are using vba 6.3
Many thanks for any help you can give.


Sub Copy_All_Sheets_To_New_Workbook()
Dim WbMain As Workbook
Dim Wb As Workbook
Dim sh As Worksheet
Dim DateString As String
Dim FolderName As String

Application.ScreenUpdating = False
Application.EnableEvents = False
DateString = "Now"
Set WbMain = ThisWorkbook
FolderName = WbMain.Path & "\" & Left(WbMain.Name, Len(WbMain.Name
- 4) '& " " & DateString
MkDir FolderName
For Each sh In WbMain.Worksheets
If sh.Visible = -1 Then
sh.Copy
Set Wb = ActiveWorkbook

' Use also this to make values from the formulas
' With Wb.Sheets(1)
' .UsedRange.Copy
' .UsedRange.PasteSpecial xlPasteValues
' .Cells(1).Select
' Application.CutCopyMode = False
' End With

Wb.SaveAs FolderName _
& "\" & Wb.Sheets(1).Name & ".xls"
Wb.Close False
End If
Next sh

MsgBox "Look in " & FolderName & " for the files"
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Thank

--
AmyTaylo
-----------------------------------------------------------------------
AmyTaylor's Profile: http://www.excelforum.com/member.php...fo&userid=2097
View this thread: http://www.excelforum.com/showthread.php?threadid=53920

 
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
Compiling Eddy[_2_] Setting up and Configuration of Excel 1 July 8th 07 04:24 PM
Problem in compiling code containing "$" char Alain79[_3_] Excel Programming 11 June 30th 05 10:07 AM
Compiling A Workbook Ken Kazinski Excel Programming 2 January 26th 05 03:30 PM
Add not compiling will Excel Programming 4 May 19th 04 01:18 PM
compiling? Jim Carlock[_2_] Excel Programming 3 September 25th 03 03:57 PM


All times are GMT +1. The time now is 09:00 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"