topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday December 14, 2024, 11:38 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: "Merge field" function  (Read 7203 times)

ajamillion

  • Participant
  • Joined in 2013
  • *
  • Posts: 6
    • View Profile
    • Donate to Member
"Merge field" function
« on: December 17, 2013, 10:13 AM »
I created an HTML "template"- in the code are "fields" that need replacement (for example, {City}, {State}, {Zip}, and one called {hrefloc}). They will get their data from a matching column in an excel spreadsheet. Each row needs to be output as an individual file, and derive it's name from the {hrefloc} column. The template is saved as {hrefloc}.html

Does this make sense?

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: "Merge field" function
« Reply #1 on: December 17, 2013, 02:45 PM »
Check out this coding snack I did 2.5 years ago, Excel2Html

ajamillion

  • Participant
  • Joined in 2013
  • *
  • Posts: 6
    • View Profile
    • Donate to Member
Re: "Merge field" function
« Reply #2 on: December 17, 2013, 02:51 PM »
I checked it out earlier- but it doesn't import the modifications into an already made HTML template, does it?

ajamillion

  • Participant
  • Joined in 2013
  • *
  • Posts: 6
    • View Profile
    • Donate to Member
Re: "Merge field" function
« Reply #3 on: December 17, 2013, 02:55 PM »
Ahh- i downloaded html to excel- wrong DL on my part. This might work!

ajamillion

  • Participant
  • Joined in 2013
  • *
  • Posts: 6
    • View Profile
    • Donate to Member
Re: "Merge field" function
« Reply #4 on: December 17, 2013, 06:08 PM »
Not working. I'm getting an error: Line 574 Error: The requested action with this object has failed.
I have triple-checked my syntax, and it seems okay.
Could it be excel 2010? I dunno.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: "Merge field" function
« Reply #5 on: December 18, 2013, 05:06 AM »
You should not have the .xls(x) file open in any other application, like Excel, maybe that's the issue?

ajamillion

  • Participant
  • Joined in 2013
  • *
  • Posts: 6
    • View Profile
    • Donate to Member
Re: "Merge field" function
« Reply #6 on: December 18, 2013, 05:27 AM »
That's not it :/
I found someone that was able to code it in python with about 15 lines of code, and they did it in under 30 minutes.. works like a charm! Thank you for your contributions though.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: "Merge field" function
« Reply #7 on: December 19, 2013, 01:35 PM »
I'm getting an error: Line 574 Error: The requested action with this object has failed.
I have triple-checked my syntax, and it seems okay.
Can you share your template (anonimized ofc, PM for e-mail) and the exact errormessage & optional logfile? I'd like to debug this some more.
My current finding is that you have some conditional thingy that triggers the error, if it's actually in the Excel2Html program.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: "Merge field" function
« Reply #8 on: December 19, 2013, 04:31 PM »
Ah, now I see what happened, you downloaded the old, obsolete and 'security'-hampered AutoIt release, that tries to get the data from the Excel file by opening it using Excel and then using select-all/copy to clipboard. There are issues with that method, as reported by others in that thread, giving the exact same error...
All these issues are resolved by the completely rewritten 2.x (Java) release, that can be downloaded from my dcmembers page, referenced in that thread (typing this on the tablet, so quite difficult to add the link here, sorry).
Maybe you could try that version.

I removed the AutoIt-based files from the Excel2Html thread.

ajamillion

  • Participant
  • Joined in 2013
  • *
  • Posts: 6
    • View Profile
    • Donate to Member
Re: "Merge field" function
« Reply #9 on: December 19, 2013, 06:15 PM »
Hey, thank you!  :)