+ Reply to Thread
Results 1 to 7 of 7

cannot share workbook with macro pulling data from another workbook

  1. #1
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    cannot share workbook with macro pulling data from another workbook

    Hello All,

    Thank you for looking into this and trying to give it a go.

    I have prepared a workbook with a macro in it that does few things to create a report. One of the "things" it does is pulling a data from another workbook while it is closed. After I save the document as a excel spreadsheet it doesn't let me share the document.

    Before I had the macro working only on the opened workbook to pull data from it and it did let me share it after I saved it.

    I have got this message popping up:

    ***Message is in attachment***

    Although when checked the maps and tables there is nothing there what this message suggests.

    And the code I used to get the data over is:

    Please Login or Register  to view this content.
    It seems like it keeps the connection with the file and it prevents me from sharing the document.

    I would appreciate any suggestion.

    Simon
    Attached Images Attached Images
    Last edited by Ramzes; 02-10-2015 at 10:34 AM. Reason: solved
    ...and this is when I walk in, dressed fully in white...

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: cannot share workbook with macro pulling data from another workbook

    A ListObject is a Table and, as the message says, you can't share a workbook with a Table in it.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    Re: cannot share workbook with macro pulling data from another workbook

    Hello,

    Thank you for your comment. Informative.

    Would you know if there is anything I can tdo to the code to make it pull that data but not to keep it as a table or not to pull it as a table?

    Sorry for asking maybe basic questiones from programming/coding, but I am a self thought through recording macroes and reading other ones that were preciously created and finding out what they do.

    Thank you

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: cannot share workbook with macro pulling data from another workbook

    Do you want the code to be run again after the workbook has been shared?

  5. #5
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    Re: cannot share workbook with macro pulling data from another workbook

    No.

    Once the code is being run then I save the workbook as macro free.

    But this table still is in it that's why I cannot share it. The code is only being run once.

    Thank you

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: cannot share workbook with macro pulling data from another workbook

    In that case just add:
    Please Login or Register  to view this content.
    after the .Refresh line.

  7. #7
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    Re: cannot share workbook with macro pulling data from another workbook

    Hi,

    I have added this to the code after the .Refresh line and before End With and unfortunately the macro stopped running on it with an error Message:

    Run-time error '1004':
    A table cannot overlap a range that contains a PivotTable report, query results, protected cells or another table.

    But I have then found the option to do and recorded the following macro:

    Please Login or Register  to view this content.
    And pasted it after End With

    And it worked.

    Thank you very much for your help - it did make me think more intensly.

    Thank you.

+ 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. Pulling data from one workbook with multiple tabs to another workbook.
    By manzier in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-29-2014, 03:41 PM
  2. Macro for pulling and updating data from one workbook to another
    By paradise2sr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-07-2014, 08:14 AM
  3. pulling data from one workbook to a sheet of another workbook
    By deelauderdale in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2010, 04:39 PM
  4. Replies: 5
    Last Post: 09-30-2008, 06:38 AM
  5. Replies: 3
    Last Post: 09-30-2008, 04:58 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