Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error refreshing pivot tables in Sharepoint PurpleMilk Excel Programming 2 August 21st 08 08:09 PM
Sharepoint List to Excel with Totals Dave_Tho1968 Excel Discussion (Misc queries) 0 October 22nd 07 09:22 PM
Can't Synchronize Excel List with Sharepoint TommyVee Excel Discussion (Misc queries) 0 July 27th 07 10:08 PM
Problem refreshing published web pages to Sharepoint with Excel 20 DrkTnn Excel Discussion (Misc queries) 0 June 28th 07 02:42 PM
Can't publish Excel list to Sharepoint LeslieR Excel Discussion (Misc queries) 4 July 20th 05 08:59 PM


All times are GMT +1. The time now is 07:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"