Consulting

Results 1 to 6 of 6

Thread: Excel VBA to server

  1. #1
    VBAX Newbie
    Joined
    Mar 2007
    Posts
    4
    Location

    Excel VBA to server

    Hi VBAExpress team.

    I need some help. I've been looking on the web for some solutions to my problem I can't seem to find any, or if I find it , it don't seem to work.

    My situation is as following. I have a couple of excel files with VBA code, and at the end of everyday it processes all the data that has been entered during the day and saves it. After that I have to e-mail a couple of files. Now the thing that I want to do is create a VBA code that after the prossesing has been done, for the file to be uploaded at the press of a button to a certain server (with user and password protection) and overwrite the existing file on the server.

    I tryed a couple of codes, but they did not work for me. I desperatly need some help, cause the unefficient work process is killing me.

    Thank you.

  2. #2
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    Do you mean by using some sort of ftp-protocol that connects to your ftp-server. Take a look at this one : http://www.xcelfiles.com/Excel02.html#anchor_35

    Charlize

  3. #3
    VBAX Newbie
    Joined
    Mar 2007
    Posts
    4
    Location
    Thanks a million. Seems to work fine. Will work on it a couple of days, but you just gave me hope back :-)

  4. #4
    VBAX Newbie
    Joined
    Mar 2007
    Posts
    4
    Location
    One more question.

    I have the following script :

    a=10
    b=10
    c=10
    d=20

    With [C2].Validation
    .Delete
    .add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
    Operator:=xlBetween, Formula1:="=D1: D1"
    .IgnoreBlank = False
    .InCellDropdown = True
    .ErrorTitle = "ERROR"
    '.InputMessage = "Select from list"
    .ErrorMessage = "Please select from dropdown list only"
    .ShowInput = True
    .ShowError = True
    End With

    The question is : How can I put a variable in the formula ?
    I need it to be something like this :

    Operator:=xlBetween, Formula1:="=ab:cd" where ab would be like Cells(a,b)
    meaning ab=J10 and cd=T10, so instead of
    Operator:=xlBetween, Formula1:="=J10:T10" i can put in the variables.

    Any ideas ?

  5. #5
    VBAX Newbie
    Joined
    Mar 2007
    Posts
    4
    Location
    Got it ... I think. Work for me anyway.

    u = Cells(10, 10).Address(RowAbsolute:=False, columnAbsolute:=False)
    uu = Cells(aa, bb).Address(RowAbsolute:=False, columnAbsolute:=False)

    With [C2].Validation
    .Delete
    .add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
    Operator:=xlBetween, Formula1:="=" & u & ":" & uu
    .IgnoreBlank = False
    .InCellDropdown = True
    .ErrorTitle = "ERROR"
    '.InputMessage = "Select from list"
    .ErrorMessage = "Please select from dropdown list only"
    .ShowInput = True
    .ShowError = True
    End With

  6. #6
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    [vba]Sub testing()
    Dim rangetovalidate As Range
    Dim rng As Range
    Dim validlist As String
    Set rangetovalidate = Application.InputBox("Select range where validationlist" & vbCrLf & _
    "will be used ... (by using your mouse)", "Give range for list to be used.", , , , , , 8)
    validlist = InputBox("Type in the range you want to use as validationlist", _
    "Give validationlistrange ...", "=J10:M10")
    For Each rng In rangetovalidate
    With rng.Validation
    .Delete
    .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
    Operator:=xlBetween, Formula1:=validlist
    .IgnoreBlank = False
    .InCellDropdown = True
    .ErrorTitle = "ERROR"
    .ErrorMessage = "Please select from dropdown list only"
    .ShowInput = True
    .ShowError = True
    End With
    Next rng
    End Sub[/vba]Charlize
    Last edited by Charlize; 03-08-2007 at 06:50 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •