#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Error

Hi all,

To me really strange, to some of you pretty common. Every morning when I
turn my computer on, startup Excel and run the code below I get a an error
message indicating that there's something happening or wrong with the
commandline;
.CreatePivotTable TableDestination:=ActiveSheet.Range("a1"),
TableName:= _
"Online", DefaultVersion:=xlPivotTableVersion10
End With

When I stop the debugger and again run the same procedure it works. I have
no clue what might be causing this. Anybody got an idea or suggestion?

Sub Online()

'Open Sharepoint

Dim ie As Object
Set ie = CreateObject("Internetexplorer.Application")
ie.Visible = False
ie.Navigate
"https://sharepoint.vodafone.com/vfnetherlands/css1/Lists/Historisch%20overzicht%20online%20diensten/Allitemsg.aspx"

'Connect & Load database

With ActiveWorkbook.PivotCaches.Add(SourceType:=xlExter nal)
.Connection = "OLEDB;Provider=Microsoft.Office.List.OLEDB.1. 0;"
.CommandType = 5
.CommandText = Array( _

"<LIST<VIEWGUID{22072B8A-1B0D-4040-8C79-D8C6AB376857}</VIEWGUID<LISTNAME{8A209ECB-7C37-4451-8BDD-6D4DEC870E00}</LISTNAME<LISTWEBhttps://sharepoint.vodafone.com/vfnetherlands/css1/_vti_bin</LISTWEB<LISTSUBWEB</LISTSUBWEB<RO" _
, _
"OTFOLDER/vfnetherlands/css1/Lists/Historisch overzicht online
diensten</ROOTFOLDER</LIST" _
)
.MaintainConnection = False
.CreatePivotTable TableDestination:=ActiveSheet.Range("a1"),
TableName:= _
"Online", DefaultVersion:=xlPivotTableVersion10
End With

'Table options
ActiveSheet.PivotTables("Online").AddFields
RowFields:=Array("Weeknummer", _
"Wie")
ActiveSheet.PivotTables("Online").PivotFields("Wie ").Orientation = _
xlDataField
Application.CommandBars("PivotTable").Visible = False
ActiveWorkbook.ShowPivotTableFieldList = False

'Close Sharepoint

ie.Quit
Set ie = Nothing

End Sub

Thanks,

Basta
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 handling error # 1004 Run-time error [email protected] Excel Programming 3 May 20th 08 02:23 PM
Error Handling - On Error GoTo doesn't trap error successfully David Excel Programming 9 February 16th 06 05:59 PM
Form Err.Raise error not trapped by entry procedure error handler [email protected] Excel Programming 1 February 8th 06 10:19 AM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Automation Error, Unknown Error. Error value - 440 Neo[_2_] Excel Programming 0 May 29th 04 05:26 AM


All times are GMT +1. The time now is 06:50 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"