Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10512

Re: Log on to BPC 10 via VBA?

$
0
0

Hi Philipp,

 

Is the user ID same as the windows login ID? If yes, then probably you can modify the code to:

 

Sub Button1_Click()

   Dim MyName as string

   Dim MyPW as string

   MyName =fOSUserName()

   MyPW = InputBox("Please enter password", "Password")

 

   client.Connect "BIS PROD", MyName, MyPW

   client.OpenSpecificDocument "spreadsheetABC.xlsm", "", "", "Input Schedules", ""

End Sub

 

Function fOSUserName() As String

    Dim lngLen As Long, lngX As Long

    Dim strUserName As String

        strUserName = String$(254, 0)

        lngLen = 255

        lngX = apiGetUserName(strUserName, lngLen - 1)

        If lngX <> 0 Then

            fOSUserName = Left$(strUserName, lngLen - 1)

        Else

            fOSUserName = ""

        End If

End Function

Hope this helps.


Viewing all articles
Browse latest Browse all 10512


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>