Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refreshing a SharePoint list in Excel
Hi,
I've got a list in an Excel file that's linked to SharePoint. If I right click anywhere in the list and choose List Discard Changes and Refresh, the list refreshes fine. However, if I use the VBA equivalent - ListObjects("List1").Refresh (the code that the macro recorder even creates) - I get an application-defined error '1004) when the refresh appears to be wrapping up. Can anyone explain? This is really bizarre and I don't want to have to do this manually. Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refreshing a SharePoint list in Excel
What line of code does it error out on?
Barb Reinhardt "Impecunious" wrote: Hi, I've got a list in an Excel file that's linked to SharePoint. If I right click anywhere in the list and choose List Discard Changes and Refresh, the list refreshes fine. However, if I use the VBA equivalent - ListObjects("List1").Refresh (the code that the macro recorder even creates) - I get an application-defined error '1004) when the refresh appears to be wrapping up. Can anyone explain? This is really bizarre and I don't want to have to do this manually. Thanks! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refreshing a SharePoint list in Excel
On Oct 15, 3:35*pm, Barb Reinhardt
wrote: What line of code does it error out on? Barb Reinhardt "Impecunious" wrote: Hi, I've got a list in an Excel file that's linked to SharePoint. *If I right click anywhere in the list and choose List Discard Changes and Refresh, the list refreshes fine. *However, if I use the VBA equivalent - ListObjects("List1").Refresh (the code that the macro recorder even creates) - I get an application-defined error '1004) when the refresh appears to be wrapping up. Can anyone explain? *This is really bizarre and I don't want to have to do this manually. Thanks!- Hide quoted text - - Show quoted text - Hi! It errors out on the refresh command itself, which in this case is the line "ActiveSheet.ListObjects("List1").Refresh. What's peculiar is that I've created another file with different lists but based on the same approach and I can programmatically refresh without a problem. However, I'd really like to fix this particular file that has the problem because it's a high-priority file. Thanks! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refreshing a SharePoint list in Excel
Try something
before that line, put this Dim myList as ListObject for each myList in activesheet.listobjects Debug.print myList.name next mylist Do you have "List1" listed? Barb Reinhardt "Impecunious" wrote: On Oct 15, 3:35 pm, Barb Reinhardt wrote: What line of code does it error out on? Barb Reinhardt "Impecunious" wrote: Hi, I've got a list in an Excel file that's linked to SharePoint. If I right click anywhere in the list and choose List Discard Changes and Refresh, the list refreshes fine. However, if I use the VBA equivalent - ListObjects("List1").Refresh (the code that the macro recorder even creates) - I get an application-defined error '1004) when the refresh appears to be wrapping up. Can anyone explain? This is really bizarre and I don't want to have to do this manually. Thanks!- Hide quoted text - - Show quoted text - Hi! It errors out on the refresh command itself, which in this case is the line "ActiveSheet.ListObjects("List1").Refresh. What's peculiar is that I've created another file with different lists but based on the same approach and I can programmatically refresh without a problem. However, I'd really like to fix this particular file that has the problem because it's a high-priority file. Thanks! |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refreshing a SharePoint list in Excel
On Oct 15, 4:19*pm, Barb Reinhardt
wrote: Try something before that line, put this Dim myList as ListObject for each myList in activesheet.listobjects * *Debug.print myList.name next mylist Do you have "List1" listed? Barb Reinhardt "Impecunious" wrote: On Oct 15, 3:35 pm, Barb Reinhardt wrote: What line of code does it error out on? Barb Reinhardt "Impecunious" wrote: Hi, I've got a list in an Excel file that's linked to SharePoint. *If I right click anywhere in the list and choose List Discard Changes and Refresh, the list refreshes fine. *However, if I use the VBA equivalent - ListObjects("List1").Refresh (the code that the macro recorder even creates) - I get an application-defined error '1004) when the refresh appears to be wrapping up. Can anyone explain? *This is really bizarre and I don't want to have to do this manually. Thanks!- Hide quoted text - - Show quoted text - Hi! *It errors out on the refresh command itself, which in this case is the line "ActiveSheet.ListObjects("List1").Refresh. What's peculiar is that I've created another file with different lists but based on the same approach and I can programmatically refresh without a problem. *However, I'd really like to fix this particular file that has the problem because it's a high-priority file. Thanks!- Hide quoted text - - Show quoted text - Hi Barb, I do, so I don't think it's an issue with using the wrong list name. As I mentioned above, the line actually executes (that is, the list seems to be refreshing over several seconds), but near the time that it should be wrapping up, I get the error. Thanks! |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refreshing a SharePoint list in Excel
I just recorded a macro to syncronize the lists. Does this work?
ActiveSheet.ListObjects("List1").UpdateChanges xlListConflictDialog -- HTH, Barb Reinhardt If this post was helpful to you, please click YES below. "Impecunious" wrote: On Oct 15, 4:19 pm, Barb Reinhardt wrote: Try something before that line, put this Dim myList as ListObject for each myList in activesheet.listobjects Debug.print myList.name next mylist Do you have "List1" listed? Barb Reinhardt "Impecunious" wrote: On Oct 15, 3:35 pm, Barb Reinhardt wrote: What line of code does it error out on? Barb Reinhardt "Impecunious" wrote: Hi, I've got a list in an Excel file that's linked to SharePoint. If I right click anywhere in the list and choose List Discard Changes and Refresh, the list refreshes fine. However, if I use the VBA equivalent - ListObjects("List1").Refresh (the code that the macro recorder even creates) - I get an application-defined error '1004) when the refresh appears to be wrapping up. Can anyone explain? This is really bizarre and I don't want to have to do this manually. Thanks!- Hide quoted text - - Show quoted text - Hi! It errors out on the refresh command itself, which in this case is the line "ActiveSheet.ListObjects("List1").Refresh. What's peculiar is that I've created another file with different lists but based on the same approach and I can programmatically refresh without a problem. However, I'd really like to fix this particular file that has the problem because it's a high-priority file. Thanks!- Hide quoted text - - Show quoted text - Hi Barb, I do, so I don't think it's an issue with using the wrong list name. As I mentioned above, the line actually executes (that is, the list seems to be refreshing over several seconds), but near the time that it should be wrapping up, I get the error. Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Error refreshing pivot tables in Sharepoint | Excel Programming | |||
Sharepoint List to Excel with Totals | Excel Discussion (Misc queries) | |||
Can't Synchronize Excel List with Sharepoint | Excel Discussion (Misc queries) | |||
Problem refreshing published web pages to Sharepoint with Excel 20 | Excel Discussion (Misc queries) | |||
Can't publish Excel list to Sharepoint | Excel Discussion (Misc queries) |