Jump to content

Import Text to Excel


Recommended Posts

your code does exactly one pass and exits the loop, as you tell it to

Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

  • Replies 48
  • Created
  • Last Reply

Top Posters In This Topic

got it... I have to form it to another func. Can't mix them in the same function. For example

(Func 1)

if (input = "") then

(message)

elseif (input = file doesn't exist) then

(message)

else

(go to Func 2)

(end Func 1)

(Func 2)

(the full import text code goes here)

(End Func 2)

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")
Link to comment
Share on other sites

Water, Boththose

I've been using the same script in all my other codes for the past year or two.

It is a simple For Loop that checks to see if the cell is empty, if not it extracts the data from the row.

There is data on 1,000 lines, and no matter where i start it it works fine on the first pass.

On the second pass (no matter which line i start the loop from), it doesn't read from the excel file, and I got the error that i previously posted about.

There is data in the row, and everything checks out the first time around fine.

I can't seem to figure out why somehow i am getting the error message, or it is not able to read from the file again.

Could someone point me in the direction of how to work with the excel error handling, or give me a little explanation on how it works, as i am not a programmer, this end of AutoIT is new to me even though i have been using the program for a while

Thanks,

Link to comment
Share on other sites

I'm getting an @error message = 5 after a _Excel_RangeRead(....) line

I'm not quite sure how to use the excel error handler on this.

Does anyone hear have any pointers, suggestions, or reference to what a 5 error message is, or how to effectively use the error handlers to figure out exactly what is going on?

Every function comes with a help file explaining how the function works including a list of error codes.

5 returned by _Excel_RangeRead means: 5 - Parameter $iReturn is invalid. Has to be > 1 and < 3

Can you please show the code you use?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Did you learn something today? If yes, you aren't an idiot ;)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Water, since it's possible to import text; is it possible to import it to an exist spreadsheet? I would assuming attach, but the example given seems to go with another route such as add it as an additional sheet. I already have 3 sheet on my exist spreadsheet and just want it to import and replace any text on sheet 2 of my existed spreadsheet.

Another way I would assume that it can be done is Send a delete all to sheet 2 then save, close spreadsheet then use the excelbookattach to open that file with my other code that boththose post.

EDIT: Nevermind; Got it...

simple as excelbookattach (location of file)

Edited by asianqueen

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")
Link to comment
Share on other sites

According to MSDN: "Loads and parses a text file as a new workbook with a single sheet that contains the parsed text-file data."

You have to copy the data or the worksheet to your target workbook.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

got that part done... Now this is a hard one, but I'm not gonna post here since it's totally different from importing, but does have to deal with excel.

Edited by asianqueen

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")
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...