Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default ThisWorkbook.Path

I have the following problem.

I want to save the active workbook and make an empty backup in the same
directory.
Code works nice, but only once.
Next execute of code the default dir of windows is used and creates a
problem.

Sub opslaan_evenement()
'
' save_event Macro
' write empty backup as "AWR leeg" in same dir
'

naam2 = Cells(1, 1)
naam3 = ThisWorkbook.Path
naam4 = naam3 + "\" + naam2

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs (naam4)
Sheets(1).Select
Range("C7:F357").Select
Selection.ClearContents
ActiveWorkbook.SaveAs ("AWR leeg")
Application.DisplayAlerts = True
'
End Sub


Mayby someone can help me !


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ThisWorkbook.Path

With your code

ActiveWorkbook.SaveAs ("AWR leeg")

you need to supply a path as well or change to that directory befor
saving

eg

ActiveWorkbook.SaveAs (thisworkbook.path & "\AWR leeg"

--
Message posted from http://www.ExcelForum.com

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
ThisWorkbook of personal.xls Jack Sons Excel Discussion (Misc queries) 4 August 29th 07 04:28 PM
hyperlink navigation path path wrong in Excel 2003 CE Admin Excel Discussion (Misc queries) 5 January 7th 06 07:47 PM
Calling Sub(s) from ThisWorkbook BSchwerdt Excel Programming 1 December 11th 03 01:36 AM
Custom Footer using ThisWorkbook.Path? debartsa Excel Programming 2 November 4th 03 01:47 PM
ThisWorkbook Macros Random Excel Programming 1 August 16th 03 04:03 PM


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