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: 360
Default compile error method or data not fount

I want to double check that the user has the right file open before he does
the save.
Do I have to do the path for the filename since the active workbook should
be open already since there is another process previous. I just want to
double check he has the right file since it saves it as a text file. I get a
compile error on the first if.
Thanks,

Private Sub saveIndesign()
'Appends date to filename so as to not write over an existing file

' saveIndesign Macro

Const fPath As String = "Mac OS X:"
Const fName As String = "Indesign"
Const fName1 As String = "SSP"






'do the save first as a txt file
If ActiveWorkbook.Filename = "Book1.xls" Then

ActiveWorkbook.SaveAs Filename:=fPath & fName & Format(Now,
"yyyymmdd_hhmmss") & ".txt"
ActiveWorkbook.Close
'then save as a normal workbook or the existing file will be changed to a
text file which is not what you want

ActiveWorkbook.SaveAs Filename:=fPath & fName1 & Format(Now,
"yyyymmdd_hhmmss") & ".xls", FileFormat:=xlWorkbookNormal

MsgBox "2 Files Saved " & fName & fPath & Format(Now, "yyyymmdd_hhmmss") &
".txt " & fName1 & fPath & Format(Now, "yyyymmdd_hhmmss") & ".xls"
Else
MsgBox "Please select the raw SSP file Book1.xls."
End If
End Sub

 
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
Compile error: Method or data member not found Brian Day Excel Worksheet Functions 0 July 22nd 07 03:20 AM
Compile Error Method or data member not found ExcelMonkey Excel Programming 1 October 4th 05 10:41 PM
Compile Error: Method or data member not found Nick S[_4_] Excel Programming 0 November 16th 04 04:43 PM
Compile Error: Method or data member not found Nick S[_3_] Excel Programming 2 November 16th 04 02:38 PM
Compile Error: Method or data member not found Nick S[_2_] Excel Programming 1 November 16th 04 11:41 AM


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