Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default macro is not saved in project but in a project.txt version

I'm getting an error message when I start to save a macro. Its confusing
because it saves the active workbook as a text file. This is scary becuase I
don't notice it and its not the project module I'm storing my work in. I
have an open blank workbook that I'm storing my macros in since my Personal
Workbook doesn't work. I run the maros from there but I have an active
worksheet open that I want to run the macros on.
----error message----
"The selected file type does not support workbooks that contain multiple
sheets.
* to save only the active sheet, click OK.
*To save all sheets, save them individuall using a different file name for
each or choose a file type that supports multiple sheets."

----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:jrough:Documents:"
Dim fName As String
Dim myFileName As String
myFileName = Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) &
Format(Now, "yyyymmdd_hhmmss") & ".txt"

fName = fPath & myFileName
ActiveWorkbook.SaveAs Filename:=fName, FileFormat:=19
MsgBox "File Saved to " & fName
End Sub

----
P.S. I just want to save this excel spreadsheet as a space delimited file
for imort to an Indesign plug-in but I keep trying to save my macro changes
in the regular project module and like I said when I save this macro it saves
the file as a texxt file okay, but then it doesn't save the work in the blank
project module only the text version of it.

thanks,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default macro is not saved in project but in a project.txt version

I don't get that prompt in xl2003 (wintel version).

But this may suppress the warning:

application.displayalerts = false
'do the save
application.displayalerts = true

====
But remember that that Txt file won't contain your code (or it won't on wintel,
anyway). That .Txt file is just plain old text--no formatting, no formulas, no
headers/footers, no code!

You'll have to keep that code in a different workbook--either personal.xls or
something else that you'll open when you need to run that procedure.


Janis wrote:

I'm getting an error message when I start to save a macro. Its confusing
because it saves the active workbook as a text file. This is scary becuase I
don't notice it and its not the project module I'm storing my work in. I
have an open blank workbook that I'm storing my macros in since my Personal
Workbook doesn't work. I run the maros from there but I have an active
worksheet open that I want to run the macros on.
----error message----
"The selected file type does not support workbooks that contain multiple
sheets.
* to save only the active sheet, click OK.
*To save all sheets, save them individuall using a different file name for
each or choose a file type that supports multiple sheets."

----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:jrough:Documents:"
Dim fName As String
Dim myFileName As String
myFileName = Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) &
Format(Now, "yyyymmdd_hhmmss") & ".txt"

fName = fPath & myFileName
ActiveWorkbook.SaveAs Filename:=fName, FileFormat:=19
MsgBox "File Saved to " & fName
End Sub

----
P.S. I just want to save this excel spreadsheet as a space delimited file
for imort to an Indesign plug-in but I keep trying to save my macro changes
in the regular project module and like I said when I save this macro it saves
the file as a texxt file okay, but then it doesn't save the work in the blank
project module only the text version of it.

thanks,


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default macro is not saved in project but in a project.txt version

thanks, I wonder if it would work if I just changed the name of this workbook
to personal.xls?
Anyway i finally figured out what it was doing. It is saving the file I
have the macro in instead of the file I want to save.

"Dave Peterson" wrote:

I don't get that prompt in xl2003 (wintel version).

But this may suppress the warning:

application.displayalerts = false
'do the save
application.displayalerts = true

====
But remember that that Txt file won't contain your code (or it won't on wintel,
anyway). That .Txt file is just plain old text--no formatting, no formulas, no
headers/footers, no code!

You'll have to keep that code in a different workbook--either personal.xls or
something else that you'll open when you need to run that procedure.


Janis wrote:

I'm getting an error message when I start to save a macro. Its confusing
because it saves the active workbook as a text file. This is scary becuase I
don't notice it and its not the project module I'm storing my work in. I
have an open blank workbook that I'm storing my macros in since my Personal
Workbook doesn't work. I run the maros from there but I have an active
worksheet open that I want to run the macros on.
----error message----
"The selected file type does not support workbooks that contain multiple
sheets.
* to save only the active sheet, click OK.
*To save all sheets, save them individuall using a different file name for
each or choose a file type that supports multiple sheets."

----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:jrough:Documents:"
Dim fName As String
Dim myFileName As String
myFileName = Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) &
Format(Now, "yyyymmdd_hhmmss") & ".txt"

fName = fPath & myFileName
ActiveWorkbook.SaveAs Filename:=fName, FileFormat:=19
MsgBox "File Saved to " & fName
End Sub

----
P.S. I just want to save this excel spreadsheet as a space delimited file
for imort to an Indesign plug-in but I keep trying to save my macro changes
in the regular project module and like I said when I save this macro it saves
the file as a texxt file okay, but then it doesn't save the work in the blank
project module only the text version of it.

thanks,


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default macro is not saved in project but in a project.txt version

Your code uses Activeworkbook.

So the file saved will depend on which workbook is active.

Janis wrote:

thanks, I wonder if it would work if I just changed the name of this workbook
to personal.xls?
Anyway i finally figured out what it was doing. It is saving the file I
have the macro in instead of the file I want to save.

"Dave Peterson" wrote:

I don't get that prompt in xl2003 (wintel version).

But this may suppress the warning:

application.displayalerts = false
'do the save
application.displayalerts = true

====
But remember that that Txt file won't contain your code (or it won't on wintel,
anyway). That .Txt file is just plain old text--no formatting, no formulas, no
headers/footers, no code!

You'll have to keep that code in a different workbook--either personal.xls or
something else that you'll open when you need to run that procedure.


Janis wrote:

I'm getting an error message when I start to save a macro. Its confusing
because it saves the active workbook as a text file. This is scary becuase I
don't notice it and its not the project module I'm storing my work in. I
have an open blank workbook that I'm storing my macros in since my Personal
Workbook doesn't work. I run the maros from there but I have an active
worksheet open that I want to run the macros on.
----error message----
"The selected file type does not support workbooks that contain multiple
sheets.
* to save only the active sheet, click OK.
*To save all sheets, save them individuall using a different file name for
each or choose a file type that supports multiple sheets."

----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:jrough:Documents:"
Dim fName As String
Dim myFileName As String
myFileName = Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) &
Format(Now, "yyyymmdd_hhmmss") & ".txt"

fName = fPath & myFileName
ActiveWorkbook.SaveAs Filename:=fName, FileFormat:=19
MsgBox "File Saved to " & fName
End Sub

----
P.S. I just want to save this excel spreadsheet as a space delimited file
for imort to an Indesign plug-in but I keep trying to save my macro changes
in the regular project module and like I said when I save this macro it saves
the file as a texxt file okay, but then it doesn't save the work in the blank
project module only the text version of it.

thanks,


--

Dave Peterson


--

Dave Peterson
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
VBA project duplicated in Project Explorer teabag Excel Programming 11 December 27th 17 11:13 AM
How to convert MS Project to MS Excel. I don't have MS Project. Jane Excel Discussion (Misc queries) 1 February 20th 06 10:01 PM
With VBA from Excel: Open Project, extract resource list and copy it to a worksheet, close project. Tony Excel Programming 1 October 18th 05 03:53 PM
Assigning the Help 4, *.HLP file for a project programmatically in a protected Project Tony Seiscons Excel Programming 0 October 4th 04 03:10 PM
Accesing vba project from wb that has vba project password protected cassidyr1 Excel Programming 2 July 3rd 04 01:49 PM


All times are GMT +1. The time now is 11:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"