Click here to Skip to main content
15,888,802 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: DateTimePicker problem with Month and Day Pin
Nagy Vilmos3-Jul-09 3:46
professionalNagy Vilmos3-Jul-09 3:46 
GeneralRe: DateTimePicker problem with Month and Day Pin
Nielvh3-Jul-09 3:59
Nielvh3-Jul-09 3:59 
GeneralRe: DateTimePicker problem with Month and Day Pin
Enver Maroshi3-Jul-09 4:06
Enver Maroshi3-Jul-09 4:06 
GeneralRe: DateTimePicker problem with Month and Day Pin
Nielvh3-Jul-09 4:15
Nielvh3-Jul-09 4:15 
GeneralRe: DateTimePicker problem with Month and Day Pin
Enver Maroshi3-Jul-09 4:23
Enver Maroshi3-Jul-09 4:23 
GeneralRe: DateTimePicker problem with Month and Day Pin
Nielvh3-Jul-09 4:33
Nielvh3-Jul-09 4:33 
GeneralRe: DateTimePicker problem with Month and Day Pin
Nielvh5-Jul-09 23:34
Nielvh5-Jul-09 23:34 
QuestionWeb Query- Com Addin Excel 2003 Pin
YakomozB3-Jul-09 2:57
YakomozB3-Jul-09 2:57 
Hi
I need some help with webqueries.
I'm trying to create a routine to ask web queries and to enter them into the current Excel cell.
I have programmed a Excel 2003 Com Addin. This is the code I receive, during Macro recording within Excel 2003 and below is the code for the VB .net Com Addin, which throws an error message.


<pre>Sub Makro1()
'

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://..." _
, Destination:=Range("A1"))
.Name = _
"foobar"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub



Now the equivalent code which throws an 0x800A03EC Error


<pre>Try
Dim currentApplication As Microsoft.Office.Interop.Excel._Application = Globals.ThisAddIn.Application


With currentApplication.ActiveSheet.QueryTables.Add(Connection:="URL;http://..." _
, Destination:=currentApplication.Range("A1")) '.ActiveCell) 'currentApplication.Range("A1"))
.Name = "foobar"

.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = Excel.XlCellInsertionMode.xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = Excel.XlWebSelectionType.xlAllTables
.WebFormatting = Excel.XlWebFormatting.xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
'.Refresh(BackgroundQuery:=False)

End With

Marshal.ReleaseComObject(currentApplication)
currentApplication = Nothing

Catch ex As Exception
Debug.Write(ex.ToString)
'MsgBox("Insert into cell not possible")
End Try



End If
End Sub

The error Message is

<pre>An Exception (First Chance??) of the type "System.Runtime.InteropServices.COMException" within

Microsoft.VisualBasic.dll is thrown.

System.Runtime.InteropServices.COMException (0x800A03EC):

The webquery is invalid

Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[]
args, String[] paramnames, Boolean[] CopyBack)

within Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String

MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)



Can anyone help me?

Thanks
QuestionHow to show DataTable in ReportViewer contral as Local Report (.rdlc) Pin
angel0in2-Jul-09 22:30
angel0in2-Jul-09 22:30 
AnswerRe: How to show DataTable in ReportViewer contral as Local Report (.rdlc) Pin
anas.safar14-Nov-10 22:11
anas.safar14-Nov-10 22:11 
QuestionHow to unlock a PC programmatically [modified] Pin
Uwe1234562-Jul-09 21:46
Uwe1234562-Jul-09 21:46 
AnswerRe: How to unlock a PC programmatically Pin
Enver Maroshi3-Jul-09 2:44
Enver Maroshi3-Jul-09 2:44 
GeneralRe: How to unlock a PC programmatically Pin
Uwe1234563-Jul-09 3:01
Uwe1234563-Jul-09 3:01 
GeneralRe: How to unlock a PC programmatically Pin
Enver Maroshi3-Jul-09 3:28
Enver Maroshi3-Jul-09 3:28 
GeneralRe: How to unlock a PC programmatically Pin
Uwe1234563-Jul-09 3:33
Uwe1234563-Jul-09 3:33 
GeneralRe: How to unlock a PC programmatically Pin
Enver Maroshi3-Jul-09 3:40
Enver Maroshi3-Jul-09 3:40 
GeneralRe: How to unlock a PC programmatically Pin
Enver Maroshi3-Jul-09 3:35
Enver Maroshi3-Jul-09 3:35 
AnswerRe: How to unlock a PC programmatically Pin
Dave Kreskowiak3-Jul-09 6:47
mveDave Kreskowiak3-Jul-09 6:47 
AnswerRe: How to unlock a PC programmatically Pin
Fahad Sadah3-Jul-09 8:10
Fahad Sadah3-Jul-09 8:10 
GeneralRe: How to unlock a PC programmatically Pin
Uwe1234563-Jul-09 8:41
Uwe1234563-Jul-09 8:41 
GeneralRe: How to unlock a PC programmatically Pin
swap.kamble30-Sep-09 20:42
swap.kamble30-Sep-09 20:42 
Questionrotate images in picturebox on button click Pin
KIDYA2-Jul-09 20:54
KIDYA2-Jul-09 20:54 
AnswerRe: rotate images in picturebox on button click Pin
dan!sh 2-Jul-09 23:39
professional dan!sh 2-Jul-09 23:39 
AnswerRe: rotate images in picturebox on button click Pin
Zahid Khan Kakar30-Jul-09 19:02
professionalZahid Khan Kakar30-Jul-09 19:02 
QuestionHow To Install Applications of A Client PC Remotely Pin
Anoop Brijmohun2-Jul-09 20:36
Anoop Brijmohun2-Jul-09 20:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.