Jump to content

Don't know how to make it work. A little help please.


Recommended Posts

I have some code below that is only a test sample but it uses the ExcelCOM_UDF.au3. It basically out puts the data to a spread sheet. That part works great. What I want it to do is when there is no excel on the PC it would output the data to a txt file. Now I do have the code to output to a txt file, but I just can get the program to run. How do I do that? I have been looking for an answer for some time now and I haven't found one. Can it be done? Am I trying something that Autoit can't do? If you would point me in the right direction that would be great. Thanks.

$ts = FileExists("c:\Program Files\Microsoft Office\Office10\excel.exe")

;MsgBox(0,"FileExists",$ts)



if $ts=1 then

#include <ExcelCOM_UDF.au3>

MsgBox(0,"FileExists",$ts)

else

MsgBox(0,"","Yes the program runs")

EndIf

RUN . . . Slide . . . TAG . . . Your out . . . PAINTBALL !!!

Link to comment
Share on other sites

I have some code below that is only a test sample but it uses the ExcelCOM_UDF.au3. It basically out puts the data to a spread sheet. That part works great. What I want it to do is when there is no excel on the PC it would output the data to a txt file. Now I do have the code to output to a txt file, but I just can get the program to run. How do I do that? I have been looking for an answer for some time now and I haven't found one. Can it be done? Am I trying something that Autoit can't do? If you would point me in the right direction that would be great. Thanks.

$ts = FileExists("c:\Program Files\Microsoft Office\Office10\excel.exe")

;MsgBox(0,"FileExists",$ts)



if $ts=1 then

#include <ExcelCOM_UDF.au3>

MsgBox(0,"FileExists",$ts)

else

MsgBox(0,"","Yes the program runs")

EndIf
Most UDFs (#include files) are just a collection of constant and variable declarations. Functions cannot be declared conditionally, so it doesn't make sense to put an #include statement inside a conditional (If/Else/EndIf). They are normally all grouped together at the top of the script.

Other than that error, there is nothing hard about what you are trying to do and your If/Else/EndIf should work fine. What happens when you try it (after putting the #include back where it belongs)?

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

PsaltyDS,

Thanks for the help. I was having a writer's block.

I was able to fix what I was doing and run a few tests on it. I chose the wrong thing to use in my example. Getting that to work was the key. Thanks again.

Edited by roofninja

RUN . . . Slide . . . TAG . . . Your out . . . PAINTBALL !!!

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...