I have what I thought was a fairly simple macro. This macro runs fine if I step thru it in debug but gives me an error 1004 if I launch it from a button from the sheet. Does anybody have any ideas? (I'm running Excel 2003 sp1 on windows XP pro 2002 sp1)
Sub PublishToIntranet()
'
'
'
On Error GoTo Err_Handler_Publish_To_Intranet
Range("A1:Q61").Select
Selection.Copy
ChDir "\\lrfp3\psm\intranetDocuments\dryer\dailyPlan"
workbooks.Open Filename:= _
"\\lrfp3\psm\IntranetDocuments\Dryer\DailyPlan\DailyPlan.xls"
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.Save
ActiveWindow.Close
MsgBox "Page published to Intranet."
Exit Sub
Err_Handler_Publish_To_Intranet:
MsgBox "Unexpected error " & Err.Number & " " & Err.Description & ". Page not published. Please contact CIS", vbOKOnly
End Sub
Bookmarks