Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

mmecombe (Programmer) (OP)
20 Jan 05 13:29
I'm using Powerbuilder 8 and I'm trying to save a datastore to an excel file.  This datastore consists of a freeform datawindow that contains header information and a detail report (separate datawindow).  When I use the SaveAs function all I get is header information but the detail information is not displayed or populated.  Also, only the html document is created.  The excel spreadshee that I try to create from the html fails.  I get the error code of -7 (No such file or unable to connect with file) when I call connectToObject.  The datastore prints out fine.  Why does SaveAs display something different from whats printed and how can I access whats printed and save to a file?  

Any help you can provide me would be greatly appreciated.

CODE

If lds_audit_summary.SaveAs(ls_name,HTMLTable!,True) = -1
Then
messageBox("Warning", "Unable to export data. Error writing to file",Exclamation!)
end if

    // Convert HTML file to Excel native format
            OLEObject excel
            excel = CREATE OLEObject
            ll_rtn = excel.ConnectToObject(ls_name)
            if ll_rtn = 0 Then
                excel.application.DisplayAlerts = FALSE
                excel.application.workbooks(1).Parent.Windows(excel.application.workbooks(1).Name).Visible = True
                ll_rtn = excel.application.workbooks(1).saveas(ls_name,60)
                excel.application.workbooks(1).close()
            end if
            
            DESTROY excel
Thanks!!
pgaec (Programmer)
28 Jan 05 23:55
Did you try SaveAsAscii() function?
mmecombe (Programmer) (OP)
31 Jan 05 12:57
Yeah, but it didn't seem to work.  I ended up creating a new grid datawindow with all the information i needed on it.  I think saved that datawindow to an htmlTable which got coverted to native excel using ole.  

Thanks for your responce.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close