h.van.bouwel
Gebruiker
- Lid geworden
- 20 jun 2004
- Berichten
- 51
Volgende macro werkt naar behoren. Je krijgt een promptje, je kan de nieuwe naam ingegeven, het document word opgeslagen, maar ik zou graag het document met de nieuwe naam sluiten.
Sub openenclose()
Dim strNieuweNaam As String
Dim strPrompt As String
Dim strTitel As String
strPrompt = "Geef de nieuwe bestandsnaam in"
strTitel = "Huidige bestand opslaan als:"
strNieuweNaam = InputBox(strPrompt, strTitel)
ActiveWorkbook.SaveAs FileName:= _
"C:\Documents and Settings\test\My Documents\" & strNieuweNaam & ".xls"
Workbooks.Open FileName:= _
"C:\Documents and Settings\test\My Documents\Macro.xls"
'Sluiten van de nieuwe file
end sub
Hoe moet ik dat dan doen?
Alvast bedankt voor de hulp
Sub openenclose()
Dim strNieuweNaam As String
Dim strPrompt As String
Dim strTitel As String
strPrompt = "Geef de nieuwe bestandsnaam in"
strTitel = "Huidige bestand opslaan als:"
strNieuweNaam = InputBox(strPrompt, strTitel)
ActiveWorkbook.SaveAs FileName:= _
"C:\Documents and Settings\test\My Documents\" & strNieuweNaam & ".xls"
Workbooks.Open FileName:= _
"C:\Documents and Settings\test\My Documents\Macro.xls"
'Sluiten van de nieuwe file
end sub
Hoe moet ik dat dan doen?
Alvast bedankt voor de hulp