Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

GetSheet from XLS File

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    GetSheet from XLS File

    Hi:

    I am on AA 5447_5206 and am trying to load a sheet from an Excel XLS file using the following code (edited):

    Code:
    	
            DIM o AS Office::ExcelDocument	
    	o.Load("C:\PcTex\XXXShipmentRevised.xls")
    	DIM c as Office::Spreadsheet
    	c = o.GetSheet(1)
    I keep getting an error on the last line, it seems as far as AA is concerned there is no sheet. The reason I am perplexed is that this code works fine (and has worked fine in other modules) with XLSX files, and if I convert the spreadsheet I'm trying to load into an XLSX file then there's no issue. I've also tried using the Office::Excel2003Document class but that doesn't work either. I've tried the code with other XLS files, even created a simple one from scratch and each time I can import an XLSX version fine, not the corresponding XLS format.

    I'd appreciate it if anyone had any ideas, I'm sure there's a simple answer but it may be years before I find it. :)


    Norman

    #2
    Re: GetSheet from XLS File

    Try DIM o AS ::Office::Excel2003Document
    Gregg
    https://paiza.io is a great site to test and share sql code

    Comment


      #3
      Re: GetSheet from XLS File

      Originally posted by madtowng View Post
      Try DIM o AS ::Office::Excel2003Document
      I tried that, there seems to be a difference (at least to Alpha Anywhere) between XLS files created with previous versions of Excel and XLS files created with the newer versions. For example, if I created the XLS file with Excel 2007 Alpha opened it fine, if I created it (or converted an XLSX file) with Office 2016 then it wouldn't (with either Excel2003Document or ExcelDocument).

      Don't know why, but thanks for the post trying to help.


      Norman

      Comment


        #4
        Re: GetSheet from XLS File

        I'm one of those people that typically likes to confirm things (not sure why).
        The biggest problem I have is that I stopped using M$Office years ago, and when
        I do use spreadsheets, I typically save them as xls instead of xlsx.

        I'm going to try to get a spreadsheet created by office2016 and/or office365.
        Gregg
        https://paiza.io is a great site to test and share sql code

        Comment


          #5
          Re: GetSheet from XLS File

          Originally posted by nlk10010 View Post
          I tried that, there seems to be a difference (at least to Alpha Anywhere) between XLS files created with previous versions of Excel and XLS files created with the newer versions. For example, if I created the XLS file with Excel 2007 Alpha opened it fine, if I created it (or converted an XLSX file) with Office 2016 then it wouldn't (with either Excel2003Document or ExcelDocument).

          Don't know why, but thanks for the post trying to help.


          Norman
          Using MS Excel 2016 - 64-bit - I saved an XLSX file as XLS, and was able to access it without issue with this code...

          Code:
          dim o as Office::Excel2003Document
          o.load("C:\AlphaProjects\Info\test.xls")
          dim c as Office::Spreadsheet
          c = o.GetSheet(1);
          dim sr1 as c
          sr1 = c.read(2,1)
          There must be other information missing about this issue. Also, you should zip and post a sample xls file that you cannot access. Maybe it's the file... maybe it's your machine. You never mention where you're trying to do this. Local dev, WAS Server, IIS Server. And you don't post the error you're getting.

          Comment


            #6
            Re: GetSheet from XLS File

            Hi Norman,

            It took a bit, but I was able to get a file created by office365 (I'm told its the same as office2016).
            The image below shows the debug(1) screen showing it recognized the worksheet, and I was able to
            read and write to the worksheet.

            I can test further, but would ask that you send sample spreadsheets to [email protected].

            2018-12-20_11-15-41.png
            Gregg
            https://paiza.io is a great site to test and share sql code

            Comment


              #7
              Re: GetSheet from XLS File

              Davidk, madtowng: I didn't get any notifications that you had posted replies, that's why I haven't gotten back with more information.

              Roughly speaking, the error involved Alpha not being able to find the worksheet (I realize that doesn't help much if at all, but I'm winging it right now).

              Let me go back and try to reproduce the issue and give you more specific information.

              Thanks both for your time and interest.


              Norman

              Comment


                #8
                Re: GetSheet from XLS File

                Well, I just tried duplicating my previous steps and now do not have any issue reading XLS spreadsheets (this code was in an XBASIC function in a UX component).

                The error that WAS reported was "An error occurred getting a spreadsheet" on the c = o.GetSheet(1).

                So there are two possibilities:

                1. The version change from 5447_5206 to 5487_5217 (the one I'm on now) did the trick, or.....
                2. I'm getting a lot older a lot faster than I thought.

                I understand #1 is the easy out, but I really worked hard on the issue when did the initial tests. I permuted and modified code, did repeated executions, etc. and continually received the "An error occurred getting a spreadsheet" message. The only way I got the module working was to insist that the company sending the spreadsheets for import make sure they were XLSX (their IT department was actually hand-coding the sheets and felt XLS would be easier).

                But, again, not only did I get around the issue by making sure the sheets were XLSX, I now can't reproduce the problem with XLS sheets no matter how hard I try.

                Oh, well.

                Thanks to you both again for taking the time to post.



                Norman

                Comment


                  #9
                  Re: GetSheet from XLS File

                  Strange things happen often. It wasn't a waste of time as I learned how to do other things while working on this.
                  Glad it's working for you now.
                  Gregg
                  https://paiza.io is a great site to test and share sql code

                  Comment

                  Working...
                  X