#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default Application

Hi.

My excel application is in a network, its a program that help the user to
report different stuff. Because the report number increase automatically the
application is saved with the new report number right after its opened, then
its saved again to another location, but this location should be temporary.

Here is the code i have.

*** First the application is saved back to its original folder with the new
report number.

ReportNumber = ActiveSheet.Range("e5").Value
ReportNumber = ActiveSheet.Range("e5").Value + 1

ActiveSheet.Range("e5").Value = ReportNumber

If Me.Saved = False Then Me.Save

*** Then its saved to a new folder ( and this should be temporary).

FileSaveName = ActiveWorkbook.Path
FileSaveNameEnd = FileSaveName & "\Arkiv\"
varName = ActiveSheet.Name
varDir = FileSaveNameEnd
varYear = Format(Date, "yy")
varNr = ReportNumber

On Error GoTo ErrorHandler:

ActiveSheet.SaveAs Filename:=varDir & varName & varNr & varYear

My question is:

Is it possible to save just the sheet and not the whole application, i dont
want the report to include the macros after it is saved to its right location.

And is there a command to delete the application after the user is done,
-the application that is saved in the temporary folder.

Mike

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Application

If you want to copy the sheet you need to copy it to a new workbook first,
then save that new workbook. If you follow those steps in Excel with the
macro recorder on you should get the code that you need.

When you say delete the application, I presume that you mean the workbook.
Check out Kill in VBA help.
--

HTH

RP
(remove nothere from the email address if mailing direct)


"Michael" wrote in message
...
Hi.

My excel application is in a network, its a program that help the user to
report different stuff. Because the report number increase automatically

the
application is saved with the new report number right after its opened,

then
its saved again to another location, but this location should be

temporary.

Here is the code i have.

*** First the application is saved back to its original folder with the

new
report number.

ReportNumber = ActiveSheet.Range("e5").Value
ReportNumber = ActiveSheet.Range("e5").Value + 1

ActiveSheet.Range("e5").Value = ReportNumber

If Me.Saved = False Then Me.Save

*** Then its saved to a new folder ( and this should be temporary).

FileSaveName = ActiveWorkbook.Path
FileSaveNameEnd = FileSaveName & "\Arkiv\"
varName = ActiveSheet.Name
varDir = FileSaveNameEnd
varYear = Format(Date, "yy")
varNr = ReportNumber

On Error GoTo ErrorHandler:

ActiveSheet.SaveAs Filename:=varDir & varName & varNr & varYear

My question is:

Is it possible to save just the sheet and not the whole application, i

dont
want the report to include the macros after it is saved to its right

location.

And is there a command to delete the application after the user is done,
-the application that is saved in the temporary folder.

Mike



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
Application.GetOpenFilename vs Application.Dialogs(xlDialogsOpen) Paul Martin Excel Programming 5 August 5th 05 04:44 PM
Replace application.RTD property by Application.RTDServers collect John.Greenan Excel Programming 1 July 7th 05 02:05 PM
macro to close excel application other than application.quit mary Excel Programming 1 September 14th 04 03:43 PM
application. ... scottnshelly[_7_] Excel Programming 3 April 7th 04 09:48 AM
application.quit will not shut off application john Excel Programming 0 January 9th 04 11:29 PM


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