View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick_Stanich[_7_] Rick_Stanich[_7_] is offline
external usenet poster
 
Posts: 1
Default Macro won't open original file?


Found one solution, see code below.

sFname = sPath & "\" & "0020-48183-fir_Cal-Precision.xls" 'Set File
Name of Original file
vFname = sPath & "\" & "0020-48183-fir_Cal-Precision-" & sDcode & "-" &
sScode & ".xls" 'Set new file name
'MsgBox sFname & " " & "Original file name" 'for testing
'MsgBox vFname & " " & "New file name" 'for testing
'Create new file name
'Check if exists, exit if exists 'need code
ActiveWorkbook.SaveCopyAs vFname 'NEW CODE
'MsgBox sFname & " " & "Original file should be open" 'for testing

This wasn't a matter of a macro not opening the original file, but the
macro closing files that did not need closing.


--
Rick_Stanich

I am me
------------------------------------------------------------------------
Rick_Stanich's Profile: http://www.excelforum.com/member.php...o&userid=28957
View this thread: http://www.excelforum.com/showthread...hreadid=512358