+ Reply to Thread
Results 1 to 4 of 4

timeout on GetSaveAs?

  1. #1
    msteiert
    Guest

    timeout on GetSaveAs?

    Hello -
    I have a user in a remote office that needs to export a file from Excel in
    text format to a server in our main office. The macro has worked in the past,
    but after setting this up for a new user, we can't get it to work. The macro
    seemingly runs correctly, but the file never shows up in the remote
    directory. The macro does work from my desk at the main office. The new user
    is also able to manually copy a file to the remote directory, so it doesn't
    appear to be a permissions issue. The one thing I have noticed, however, is
    that the access to the server from the remote office is very slow. Could this
    command be timing out? It takes a minute or two for the server directory to
    manually appear on the remote user's computer.
    Here is the code we are using:
    '
    ' export text file to desktop

    ChDir "\\sys002sv\Newsroom\DTIImport\MiscCharts"

    fileSaveName = Application.GetSaveAsFilename( _
    initialFileName:="\\sys002sv\Newsroom\DTIImport\MiscCharts\MS_Bus_Lic",
    filefilter:="Text files (*.txt),*.txt")
    If fileSaveName <> False Then
    MsgBox "Saved File to " & fileSaveName
    Else
    MsgBox "Save Cancelled!"
    End If
    End Sub

    thanks for any help - The only ugly workaround I can think of now is to have
    the file save to the desktop, then do a manual copy.

  2. #2
    Vic Eldridge
    Guest

    RE: timeout on GetSaveAs?

    The code you posted doesn't save anything anywhere. All it does is fill your
    fileSaveName variable with a path to a file.

    Regards,
    Vic Eldridge


    "msteiert" wrote:

    > Hello -
    > I have a user in a remote office that needs to export a file from Excel in
    > text format to a server in our main office. The macro has worked in the past,
    > but after setting this up for a new user, we can't get it to work. The macro
    > seemingly runs correctly, but the file never shows up in the remote
    > directory. The macro does work from my desk at the main office. The new user
    > is also able to manually copy a file to the remote directory, so it doesn't
    > appear to be a permissions issue. The one thing I have noticed, however, is
    > that the access to the server from the remote office is very slow. Could this
    > command be timing out? It takes a minute or two for the server directory to
    > manually appear on the remote user's computer.
    > Here is the code we are using:
    > '
    > ' export text file to desktop
    >
    > ChDir "\\sys002sv\Newsroom\DTIImport\MiscCharts"
    >
    > fileSaveName = Application.GetSaveAsFilename( _
    > initialFileName:="\\sys002sv\Newsroom\DTIImport\MiscCharts\MS_Bus_Lic",
    > filefilter:="Text files (*.txt),*.txt")
    > If fileSaveName <> False Then
    > MsgBox "Saved File to " & fileSaveName
    > Else
    > MsgBox "Save Cancelled!"
    > End If
    > End Sub
    >
    > thanks for any help - The only ugly workaround I can think of now is to have
    > the file save to the desktop, then do a manual copy.


  3. #3
    msteiert
    Guest

    RE: timeout on GetSaveAs?

    Vic -
    Thanks for the reply.
    I wasn't too clear before -- the code I posted will give the user a Save As
    prompt in the directory that I want them to save in, which is a server share
    directory, along with a suggested name. They actually insert the addition to
    the name and click the "save" button on the dialog box.
    This happens with the script now -- the user gets the prompt, and clicks
    "save", but the file never shows up. I'm wondering if there is some sort of
    error that the script is blowing through that I'm not checking for -- perhaps
    a timeout.


    "Vic Eldridge" wrote:

    > The code you posted doesn't save anything anywhere. All it does is fill your
    > fileSaveName variable with a path to a file.
    >
    > Regards,
    > Vic Eldridge
    >
    >
    > "msteiert" wrote:
    >
    > > Hello -
    > > I have a user in a remote office that needs to export a file from Excel in
    > > text format to a server in our main office. The macro has worked in the past,
    > > but after setting this up for a new user, we can't get it to work. The macro
    > > seemingly runs correctly, but the file never shows up in the remote
    > > directory. The macro does work from my desk at the main office. The new user
    > > is also able to manually copy a file to the remote directory, so it doesn't
    > > appear to be a permissions issue. The one thing I have noticed, however, is
    > > that the access to the server from the remote office is very slow. Could this
    > > command be timing out? It takes a minute or two for the server directory to
    > > manually appear on the remote user's computer.
    > > Here is the code we are using:
    > > '
    > > ' export text file to desktop
    > >
    > > ChDir "\\sys002sv\Newsroom\DTIImport\MiscCharts"
    > >
    > > fileSaveName = Application.GetSaveAsFilename( _
    > > initialFileName:="\\sys002sv\Newsroom\DTIImport\MiscCharts\MS_Bus_Lic",
    > > filefilter:="Text files (*.txt),*.txt")
    > > If fileSaveName <> False Then
    > > MsgBox "Saved File to " & fileSaveName
    > > Else
    > > MsgBox "Save Cancelled!"
    > > End If
    > > End Sub
    > >
    > > thanks for any help - The only ugly workaround I can think of now is to have
    > > the file save to the desktop, then do a manual copy.


  4. #4
    Vic Eldridge
    Guest

    RE: timeout on GetSaveAs?

    You would need to show us how you're saving the file. Are you using the
    SaveAs method on a workbook or a worksheet ? Or are you using the Open
    statement to write to the text file ?
    The code you posted does not show how you're saving the file (which is where
    the problem is likely to be). GetSaveAsFilename (by itself) does not save
    files, it merely returns a string containing the path to a file.

    Regards,
    Vic Eldridge







    "msteiert" wrote:

    > Vic -
    > Thanks for the reply.
    > I wasn't too clear before -- the code I posted will give the user a Save As
    > prompt in the directory that I want them to save in, which is a server share
    > directory, along with a suggested name. They actually insert the addition to
    > the name and click the "save" button on the dialog box.
    > This happens with the script now -- the user gets the prompt, and clicks
    > "save", but the file never shows up. I'm wondering if there is some sort of
    > error that the script is blowing through that I'm not checking for -- perhaps
    > a timeout.
    >
    >
    > "Vic Eldridge" wrote:
    >
    > > The code you posted doesn't save anything anywhere. All it does is fill your
    > > fileSaveName variable with a path to a file.
    > >
    > > Regards,
    > > Vic Eldridge
    > >
    > >
    > > "msteiert" wrote:
    > >
    > > > Hello -
    > > > I have a user in a remote office that needs to export a file from Excel in
    > > > text format to a server in our main office. The macro has worked in the past,
    > > > but after setting this up for a new user, we can't get it to work. The macro
    > > > seemingly runs correctly, but the file never shows up in the remote
    > > > directory. The macro does work from my desk at the main office. The new user
    > > > is also able to manually copy a file to the remote directory, so it doesn't
    > > > appear to be a permissions issue. The one thing I have noticed, however, is
    > > > that the access to the server from the remote office is very slow. Could this
    > > > command be timing out? It takes a minute or two for the server directory to
    > > > manually appear on the remote user's computer.
    > > > Here is the code we are using:
    > > > '
    > > > ' export text file to desktop
    > > >
    > > > ChDir "\\sys002sv\Newsroom\DTIImport\MiscCharts"
    > > >
    > > > fileSaveName = Application.GetSaveAsFilename( _
    > > > initialFileName:="\\sys002sv\Newsroom\DTIImport\MiscCharts\MS_Bus_Lic",
    > > > filefilter:="Text files (*.txt),*.txt")
    > > > If fileSaveName <> False Then
    > > > MsgBox "Saved File to " & fileSaveName
    > > > Else
    > > > MsgBox "Save Cancelled!"
    > > > End If
    > > > End Sub
    > > >
    > > > thanks for any help - The only ugly workaround I can think of now is to have
    > > > the file save to the desktop, then do a manual copy.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1