+ Reply to Thread
Results 1 to 7 of 7

excel vba runtime error 1004 "this action won't work on multiple selections"

  1. #1
    Forum Contributor aprildu's Avatar
    Join Date
    04-13-2014
    Location
    Barrie,On, Canada
    MS-Off Ver
    Excel 2016
    Posts
    175

    excel vba runtime error 1004 "this action won't work on multiple selections"

    I have this routine of copying sheets from some child workbooks and pasting to the parent file. It works fine in a local folder however it gives "excel vba runtime error 1004 this action won't work on multiple selections" error when it is run in a sharepoint folder. Not sure if it matters but the parent workbook (where the macro is run) is opened on a computer with office 365 but the rest child workbooks are not. Don't think it matters as they are all saved in a sharepoint folder but just in case. Any help appreciated!!

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: excel vba runtime error 1004 "this action won't work on multiple selections"

    Hmm, so ... where is it ? This routine ...

  3. #3
    Forum Contributor aprildu's Avatar
    Join Date
    04-13-2014
    Location
    Barrie,On, Canada
    MS-Off Ver
    Excel 2016
    Posts
    175

    Re: excel vba runtime error 1004 "this action won't work on multiple selections"

    Sample code: I have removed the checking if the child file is open or not to simplify it:


    Please Login or Register  to view this content.
    Last edited by aprildu; 09-07-2018 at 06:07 PM.

  4. #4
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: excel vba runtime error 1004 "this action won't work on multiple selections"


    What is before "Set mFSO = New FileSystemObject" ?
    What is after "Application.DisplayAlerts = True" ?
    Each procedure/routine/Subroutine/etc. (in vba) begins with "Sub name_of_procedur ()" and ends with "End Sub".

  5. #5
    Forum Contributor aprildu's Avatar
    Join Date
    04-13-2014
    Location
    Barrie,On, Canada
    MS-Off Ver
    Excel 2016
    Posts
    175

    Re: excel vba runtime error 1004 "this action won't work on multiple selections"

    Please ignore that. I don't think it's the cause as this routine works perfectly in a local folder. It's only when they are all in a sharepoint folder it throws the error. It once actually worked in the sharepoint folder before.

  6. #6
    Registered User
    Join Date
    08-08-2023
    Location
    Newcastle-under-Lyme, England
    MS-Off Ver
    365
    Posts
    1

    Re: excel vba runtime error 1004 "this action won't work on multiple selections"

    Hello All,

    I have had this error ("runtime error 1004 "this action won't work on multiple selections") when copying a range of cells from source data spreadsheets into a master report spreadsheet.
    It's very frustrating as the solution does not seem to be obvious to me. The files are contained in a "sharepoint" environment and I'm using office 365.

    What worked for me was to use range1.value2=range2.value2 instead of "cells(1,1).pastespecial paste:=xlpastevalues" which caused the error message, "runtime error 1004 "this action won't work on multiple selections".

    I set the copy range as a range in the source spreadsheet and set a same size range on the destination spreadsheet.

    LastRow = WS9.Cells(Rows.Count, 8).End(xlUp).Row 'defined the bottom row of the range which started at row 28
    Set myRange = Range(WS9.Cells(28, 2), WS9.Cells(LastRow, 19)) 'WS9 was (Set WS9 = myWB.Sheets("Resource_Profile")) my source data spreadsheet

    PasteRow = RES.Cells(Rows.Count, 8).End(xlUp).Row 'RES was the destination spreadsheet
    Set oRange = RES.Cells(PasteRow + 1, 2).Resize(LastRow - 27, 18)'the destination range
    oRange.Value2 = myRange.Value2

    this approach solved the problem for me.

    Regards, Martin.

  7. #7
    Registered User
    Join Date
    07-26-2023
    Location
    Oklahoma
    MS-Off Ver
    365
    Posts
    57

    Re: excel vba runtime error 1004 "this action won't work on multiple selections"

    Don't know if this applies to a SharePoint folder, but if it's like a OneDrive folder, you may need to replace the "internet address" portion of the SharePoint folder location with the local path.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro Not Working in "Protected View". Runtime Error 1004
    By rxharp419 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2018, 04:12 AM
  2. [SOLVED] Frequently Used Macro now Giving a" Runtime Error '1004 Application-Object Defined Error"
    By rjw524 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-02-2015, 02:39 PM
  3. Issue with "Runtime error 1004: Cannot rename a sheet to the same name..."
    By joch329 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-26-2014, 10:21 PM
  4. [SOLVED] Excel VBA Runtime error '1004' "If WorksheetFunction.Find" function
    By miguelitoven in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-11-2013, 04:34 PM
  5. Excel VBA Runtime error 1004 "Select method of Range class failed"
    By jeskit in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-09-2012, 10:16 AM
  6. runtime error "1004", no data selected to parse
    By surgical in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-10-2010, 11:41 AM

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