Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Maya Hughes   on Sep 12 In MS Office Category.

  
Question Answered By: Vidhya Iyer   on Sep 12

I am at home so I can't try deleting it
until Tuesday but I changed the name of the workbook
that works to personal.xls. I am at home I now have my
personal workbook.

I don't understand how that is different from using
any other workbook  name? Right now it is a blank
workbook that stores the project  I am working on and
it has to be open to run these macros  but am running
them on another spreadsheet report that has to be
doctored up each week. This other report I need to
save as a text file for input to Indesign via a
plug-in. Every week! I have that spreadsheet as the
active one (open on top) .

The problem  came about when I have the project
workbook open (now named  personal.xls) that it saves
itself, the project file (personal.xls) as text NOT
the spreadsheet report I want to save  as text. Then
it crashes itself , most of the time, it gives this
weird message and then sometimes it saves itself as a
text file which is totally wrong. I want my personal
workbook to save the macros I use each week.

The value 19 is supposed to be a Mac text file. I
tried putting the application display alert sign in
there to get it to bypass the alert.
This alert step doens't work at all so there is
something wrong with the path or the code. Someone
told me this error  doens't happen on a PC.
----error message-----
"run-time error '1004' The file could not be
accessed. try one of the following:
make sure the specified folder exists. make sure the
folder is not read only....."

----macro--------

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

' saveIndesign Macro

Const fPath As String = "Mac OS X:Desktop: "
Dim fName As String
Dim myFileName As String
myFileName = Left(ActiveWorkbook.Name,
Len(ActiveWorkbook.Name) - 4) & Format(Now,
"yyyymmdd_hhmmss") & ".txt"


fName = fPath & myFileName
Application.DisplayAlerts = False
'do the save


ActiveWorkbook.SaveAs Filename:=fName, FileFormat:=19
Application.DisplayAlerts = True

MsgBox "File Saved to " & fName
End Sub

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Personal Workbook corrupted Or get search suggestion and latest updates.


Tagged: