+ Reply to Thread
Results 1 to 13 of 13

Issue with excel 2016 64 bit and excel 2013 32 bit.

  1. #1
    Registered User
    Join Date
    10-25-2017
    Location
    mmmm
    MS-Off Ver
    2016
    Posts
    15

    Exclamation Issue with excel 2016 64 bit and excel 2013 32 bit.

    So Im working in a project with vba, I have two machines, one's at home, and the other one at my job. There are these small things Im having trouble with. When I work at home, Im working with Excel 2016 64 bits, so I write down code and everything works. Once I get to my job, sometimes the code fails. At my job, I work with Excel 2013 32 bit, so this is causing me trouble because I spend more time solving these new issues I've got because of versioning than actually writing code.

    All I want to know is if this is a thing. I mean this is my conclusion because of self experience, but maybe you guys can tell me that Im not crazy and this is actually a versioning issue. I've tried searching in the web for an explanation and I haven't found anything solid yet.

    So, just to give you an idea...

    I've got this code with 2016 64-bit:


    Please Login or Register  to view this content.
    Basically, tb_Interes is a textbox with a percentage value, so Im dropping the percentage and getting just the number, dividing it by 100, adding 1 and finally multiplying by tb_CantidadSiguientePagoSemanal, which has the value that I want to apply the percentage:

    -> 10%
    -> .1
    -> 1+.1 = 1.1
    ->1.1 * (tb_CantidadSiguientePagoSemanal)
    -> Save the value in the same textbox tb_CantidadSiguientePagoSemanal

    While working with Excel 2016 64 bit, everything works and I get the value I want, but when I'm in 2013 32 bit, it fails with a type mismatch error

    If it's a compatibility problem, is there any recommendation/solution that you can provide? I'm tired of rewriting code, feels like double working the same issue.

    I will appreciate any answer,

    Regards!!

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Issue with excel 2016 64 bit and excel 2013 32 bit.

    I don't have either version to test, but maybe 2013 prefers more explicit coercion:

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    10-25-2017
    Location
    mmmm
    MS-Off Ver
    2016
    Posts
    15

    Re: Issue with excel 2016 64 bit and excel 2013 32 bit.

    Guess It's impossible to work with both versions, I would need to rework always if I want to use both. I'll keep 2016 64 bit

  4. #4
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Issue with excel 2016 64 bit and excel 2013 32 bit.

    If you are using any libraries/references they will need to bit match the platform you are on. Its possible to programatically check if your on 64 bit or 32 bit and reference the appropriate libraries. Thats generally the issue faced when going between bit versions. Hard to say with only a small snippet of your code. A google search of something like "Excel VBA 64bit" will find you plenty of examples of this.
    Ways to get help: Post clear questions, explain your overall goal, supply as much background as possible, respond to questions asked of you by those trying to help and post sample(s) files.

    "I am here to help, not do it for people" -Me

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Issue with excel 2016 64 bit and excel 2013 32 bit.

    As far as I can see there's nothing in that code that would be affected by different versions of Excel being used.
    If posting code please use code tags, see here.

  6. #6
    Registered User
    Join Date
    10-25-2017
    Location
    mmmm
    MS-Off Ver
    2016
    Posts
    15

    Re: Issue with excel 2016 64 bit and excel 2013 32 bit.

    Thanks for the answers!!

    I think it's just unnecessary to work in both versions, but I thought I could work in both using the same code. I will just start using use one.

  7. #7
    Registered User
    Join Date
    10-25-2017
    Location
    mmmm
    MS-Off Ver
    2016
    Posts
    15

    Re: Issue with excel 2016 64 bit and excel 2013 32 bit.

    Yup, doing some research, it should work on both, but I already spent a lot of time reworking and doing research, and this code works perfectly on 2016 64 bit so, as I said, I will just stop using 2013 32 bit, thanks!!!

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Issue with excel 2016 64 bit and excel 2013 32 bit.

    We've not really seen enough of the code to tell you what the problem could be I'm afraid.

    One thing I would recommend though is not to use symbols, e.g. currency, percentage etc, in textboxes when they're values are going to be used in calculation.

    PS As you can probably see from shg's code, you can use VBA's Format instead of Application.WorksheetFunction.Text if you do need to format values in the code.

  9. #9
    Registered User
    Join Date
    10-25-2017
    Location
    mmmm
    MS-Off Ver
    2016
    Posts
    15

    Re: Issue with excel 2016 64 bit and excel 2013 32 bit.

    I cant show the entire code, it's kind of huge, it's true that it could be another thing popping the error but it's not the first time this happens to me while migrating my job to version 2013 32 bit, so it gives me reasons to think about this being the root cause of the error. I have had a lot of problems using VBA's Format, Application.WorksheetFunction.Text was my last option to write down, but it worked. I'll prepare the piece of the code so you can check it, but so you can have a little bit of insight...

    The issue I had, I was saving a value from a TextBox to a cell in a worksheet as Currency. Let's say 192.37. To save it, I just did a Worksheets("Sheet1").Cells(1,1) = CCur(TextBox.Value), and in cell it looked like $192.37 (I didnt use any format, just changed the data type to currency). To display that number back to another textbox, I took it from cell(1,1) and running the userform the number looked like this 19,237, or this 19,237.00. I tried everything, VBA's Format, change the number to Double and back to Currency, concatenate $ symbol, tried every format I found on internet and didnt work. It was until I found in a youtube video where they were using Application.WorksheetFunction.Text and it worked very well, I can even make calculations with the value and save it back to worksheet, I'm not saying is the most efficient way or even the right way, but after hours searching for answers, it worked for me.

    As I said, I will make a small document so you can see the code and try to figure out what's happening, but that currency data type along with the text box had given me a really hard time.

    Thanks everyone for the help!! Feels good to finally get answers. Hope you can see the file in a few hours.

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Issue with excel 2016 64 bit and excel 2013 32 bit.

    If you want to get the value from a cell as it's formatted in the cell use it's Text property.

  11. #11
    Registered User
    Join Date
    10-25-2017
    Location
    mmmm
    MS-Off Ver
    2016
    Posts
    15

    Re: Issue with excel 2016 64 bit and excel 2013 32 bit.

    Then what's the difference between using Application.WorksheetFunction.Text and the Text property? Aren't they the same in functionality?

  12. #12
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Issue with excel 2016 64 bit and excel 2013 32 bit.

    No, Application.Worksheet.Function.Text is used to apply the TEXT worksheet function in VBA, the Text property returns the value from a cell as it's displayed.

  13. #13
    Registered User
    Join Date
    10-25-2017
    Location
    mmmm
    MS-Off Ver
    2016
    Posts
    15

    Re: Issue with excel 2016 64 bit and excel 2013 32 bit.

    Alright, I will change it then, and will let you know if there are further issues, thanks!!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel 2016 Exports PDF 10x the size of Excel 2013
    By oiltech999 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-16-2017, 07:20 PM
  2. [SOLVED] Issue send email with excel 2016 true outlook 2016
    By kirana2014 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-12-2017, 11:34 AM
  3. Excel 2013 and Excel 2016 still flickering after ScreenUpdating is off
    By catalystsystems in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-07-2017, 06:57 PM
  4. Replies: 1
    Last Post: 04-01-2017, 04:53 AM
  5. 2013 excel to 2016 excel now creating a bug
    By margal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-25-2016, 08:22 PM
  6. Excel 2013 Macros with Win 10 + Excel 2016
    By sunilvs24 in forum Office 365
    Replies: 2
    Last Post: 07-19-2016, 05:45 AM
  7. Macro From Excel 2013 Not Working in 2016
    By tm1238 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-08-2016, 04:39 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1