question

BBGMetalmeccanica-3726 avatar image
0 Votes"
BBGMetalmeccanica-3726 asked emilyhua-msft commented

Macro no longer working after downgrade from office 2015 to 2010

Good morning
I wanted to show you this macro that I used and it worked fine until I installed office 2010. First on the pc there was office 2016 installed. I also posted the code, the macro copies a sheet from an excel file and pastes it into another file excel and appends the copy to a sheet.
I can't understand why it doesn't work anymore. If anybody please have any ideas and want to help me.
Greetings and thanks

 Sub AccodaFogliKitamura()
    
   Dim wbk1 As Workbook
   Dim wbk2 As Workbook
   Dim Sheet1 As Worksheet
   Dim Sheet2 As Worksheet
   Dim lriga, lriga2 As Long
   Dim rng1, rng2 As Range
      
      
   Application.ScreenUpdating = False
     
      
    Set wbk1 = Workbooks.Open("C:\Users\fabri\Documents\BBG\BBG-PROGRAMMAZIONE-LAVORO.xlsm")
     
       
    Set Sheet1 = wbk1.Sheets("Kitamura")
       
    With Sheet1
     lriga = .Range("A" & .Rows.Count).End(xlUp).Row
    End With
      
    Set wbk2 = Workbooks.Open("C:\Users\fabri\Documents\BBG\CERCA-DATA-LEVIEN-EURO.xlsm")
     
      
    Set Sheet2 = wbk2.Sheets("FogliAccodati")
       
    With Sheet2
     lriga2 = .Range("A" & .Rows.Count).End(xlUp).Row
    End With
       
    
      
    Sheet1.Range("A2 : K" & lriga).Copy _
    Destination:=Sheet2.Range("A" & lriga2)
    
    Application.ScreenUpdating = True
   End Sub


office-vba-devoffice-itpro
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@BBGMetalmeccanica-3726
The tag "office-itpro" focus on general issues of Office apps, as your issue is more related to VBA code, to better help you, I would add a new tag "office-vba-dev", thanks for your understanding.

0 Votes 0 ·

0 Answers