+ Reply to Thread
Results 1 to 2 of 2

Macro won't open original file?

Hybrid View

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,177
    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 the file that did not need closing. Performing a "SaveAs" instead of a "SaveCopyAs" was closing the only excel file that was open. Allthough, I am not sure why I could not open a workbook after the close.
    Last edited by Rick_Stanich; 02-14-2006 at 06:36 PM.
    Regards

    Rick
    Win10, Office 365

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1