Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Test for file existence


Hi Tom,

I just got a method 'saveas' of object 'workbook' failed. Any Ideas?

Cheer

--
Josep

-----------------------------------------------------------------------
Joseph's Profile: http://www.excelforum.com/member.php...nfo&userid=563
View this thread: http://www.excelforum.com/showthread.php?threadid=27773

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Test for file existence

I changed P to C and created you structure. This revision worked fine for
me. (I changed C back to P).


Sub AAAA()

sName = "P:\clevedon staff\activities\" & _
Application.UserName & "\" & Application.UserName _
& " " & Format(Now, "DDMMYY") & " ActivityLog.csv"

If Dir(sName) < "" Then
Kill sName
End If
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
sName, FileFormat:=xlCSV, _
Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False
ActiveWorkbook.Saved = True
Application.Quit
Application.DisplayAlerts = True

End Sub

--
Regards,
Tom Ogilvy


"Joseph" wrote in message
...

Hi Tom,

I just got a method 'saveas' of object 'workbook' failed. Any Ideas?

Cheers


--
Joseph


------------------------------------------------------------------------
Joseph's Profile:

http://www.excelforum.com/member.php...fo&userid=5637
View this thread: http://www.excelforum.com/showthread...hreadid=277733



Reply
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
Formula to test for existence of external file Al at Novelis Excel Worksheet Functions 2 August 29th 06 01:13 AM
Test for file existence Joseph[_45_] Excel Programming 1 November 12th 04 04:04 PM
Existence, Search, Test JohnNews Excel Programming 0 October 11th 04 05:48 PM
Test for existence of Name Jack Schitt Excel Programming 2 April 6th 04 06:51 PM
how do i test for the existence of a range name Jake Marx[_3_] Excel Programming 2 March 3rd 04 09:57 PM


All times are GMT +1. The time now is 03:02 PM.

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"