Jump to content

FileExists Problem


Recommended Posts

For some reason my FileExists statement will not work. Can anyone see what I am doing wrong?

Statement to save excel file (enters data in save as box and clicks enter).

If $domestic <> "D" then

Send("C:\"&$short_name&" International Detail "&$remit&"")

Send("{ENTER}")

EndIf

Statement to close excel once file has saved:

If $domestic <> "D" then

While $flag = 0

If FileExists("C:\"&$short_name&" International Detail "&$remit&".xls") Then

ProcessClose("excel.exe")

ExitLoop

EndIf

WEnd

EndIf

Link to comment
Share on other sites

Link to comment
Share on other sites

u gonna need to but a couple of debug points in your code to see what value $Domestic $Flag are returning.

put a messagebox(0,"Value of $Domestic + $Flag",$Domestic&" "&$Flag)

before both your save and close excel If statemnts. Other than that we need a bit more code to see what you actually defining in those variables.

HardCopy

Edited by HardCopy

Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad

Link to comment
Share on other sites

If $domestic <> "D" then

Send("C:\"&$short_name&" International Detail "&$remit&"")

Send("{ENTER}")

EndIf

Well u tagging an extra null on the end here!! dunno if that would kill it.

change "" to ".xls" try that

Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad

Link to comment
Share on other sites

If $domestic <> "D" then

Send("C:\"&$short_name&" International Detail "&$remit&"")

Send("{ENTER}")

EndIf

Well u tagging an extra null on the end here!! dunno if that would kill it.

change "" to ".xls" try that

<{POST_SNAPBACK}>

try putting a space on either side of each of your &'s... if nothing else it will help readability. i know in vbs it doesn't like it when &'s are appended to variable names.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...