Results 1 to 4 of 4

Use Code written in xlsm file to open .xls file and copy-paste data from xls to xlsm file

Threaded View

  1. #1
    Registered User
    Join Date
    05-20-2013
    Location
    Cyprus
    MS-Off Ver
    Excel 2007
    Posts
    6

    Use Code written in xlsm file to open .xls file and copy-paste data from xls to xlsm file

    Hello guys, i just have a simple code in .xml file that opens a .xls files, selects a specific range, copies it and pastes it as values in the .xml file
    The code opens the .xls file but then i recieve a Microsoft "Visual Basic 400" error.

    Here is the code

    Sub copy_spread_data()
        
    ' The following two lines of code and the two last lines speed up the process
    Application.ScreenUpdating = False
    Application.Calculation = xlCalculationManual
    
        Credit_Score_Workbook = ActiveWorkbook.Name 
        Workbooks.Open Filename:=Range("XDX2")
        Sheets("RATIOS").Select
        Range("A1:F100").Select
        Selection.Copy
    
        Windows(Credit_Score_Workbook).Activate
        Sheets("Spread").Select
        Range("A1").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("Spreads List").Select
        Range("A10").Select
        
        
        
     ' The following two lines  with the two first lines of code
    ' serve in speeding up the process
    Application.ScreenUpdating = True
    Application.Calculation = xlCalculationAutomatic
    
    End Sub
    any suggestions ?
    Last edited by kgiorgosss; 05-21-2013 at 05:24 AM.

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