LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Error calling Web Service from Excel Application

Please find code below which is run by an Excel macro. I am trying to make
this call a Webservice I wrote in another C# solution.

When the code trys to run this method, it gives the error "Execution
permission cannot be acquired". Even the MsgBox At the Top does not appear.
However, if I comment the line token = new usernameToken(..., The MsgBox Came
to the End will appear.

Does anyone know what is the problem.

Thanks
Guha
PS. This application
Imports Office = Microsoft.Office.Core (Microsoft Office 11.0 Object Library)
Imports Excel = Microsoft.Office.Interop.Excel (Microsoft Excel 11.0 Object
Library)
<<<<<<<<<<<<<<<<<<<
Public Sub PostToSwims(ByVal publisherName As String, _
ByVal vendorName As String, _
ByVal programName As String, _
ByVal effectiveDate As String, _
ByVal jobDesc As String, _
ByVal fileName As String)
MsgBox("At the top")
Dim strResult As String
Dim token As UsernameToken
Dim username As String = "BLAHBLAH"
Dim passwordBytes() As Byte = System.Text.Encoding.UTF8.GetBytes("BSBSBS")
Array.Reverse(passwordBytes)
Dim passwordEquivalent As String

passwordEquivalent = Convert.ToBase64String(passwordBytes)
token = Nothing

Try
token = New UsernameToken(username, passwordEquivalent,
PasswordOption.SendPlainText)
Catch ex As Exception
MsgBox(ex.Message)
End Try

MsgBox("Came to the End")

End Sub
 
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
Excel calling WCF service K. Wilder Excel Discussion (Misc queries) 0 February 25th 10 10:52 PM
Calling an application from excel SatyanarayanaS Excel Worksheet Functions 1 May 14th 08 02:50 PM
calling web service from excel 2000 Steve Richter Excel Programming 1 April 15th 05 09:43 PM
Problems calling a procedure in another application msk19[_3_] Excel Programming 1 September 14th 04 12:49 PM
calling an Excel Add-in application McNiwram Excel Programming 2 December 19th 03 02:39 PM


All times are GMT +1. The time now is 06:17 AM.

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

About Us

"It's about Microsoft Excel"