Personal Project - Few issues and Questions

I'll try and work it through on my 64bit system later today.
 
Okay thanks. When I get to my computer I'll post the current updated version
 
Hey buddy, here's the current file.

If you can also look at something else for me that has me completely stumped. On the Options Sheet I have a button "Replace Color" with this code
Code:
Sub Button1_Click()
    Dim ColorValue
    'ColorValue = "RGB(" & Worksheets("Options").Range("H11").Value & ")"
    ColorValue = "RGB(" & Worksheets("Options").Range("H11").Value & "," & Worksheets("Options").Range("I11").Value & "," & Worksheets("Options").Range("J11").Value & ")"
    If ActiveCell = Worksheets("Options").Range("F3") Then
        Worksheets("Options").Range("H12").Value = ColorValue
        ActiveWorkbook.Colors(1) = ColorValue
    End If
End Sub

You type in R G B values in 3 boxes and then you click on the black 1 square above to make it the active cell, then click the button. It reads the R G and B and puts it in the format of RGB = (#, #, #) which is working properly.
Then it is supposed to set the ActiveWorkbook.Colors(1) to that value. The code all works no errors but the last line is not happening:

Code:
        ActiveWorkbook.Colors(1) = ColorValue

If I add a new line at the end just setting a color like
Code:
        ActiveWorkbook.Colors(1) = RGB (255, 255, 255)

That line works..so something is wrong with the other line...I am stumped.

Thanks in advance for that issue and the 64 bit issue. I googled 64 bit and tried adding LongLong's and all the stuff I found but had no luck getting it fully working.
 

Attachments

  • TradeRoute - 2-24-15.xlsm
    121.7 KB · Views: 8
The colors stuff I fixed, had to use different code but it's all done so you can ignore.

I wanted to add one column and one row left of and on top of the data table but I don't know what to change in all the spinbutton stuff that you rewrote for me..could you help me with that? Maybe commenting which things to change in case i ever need to add more rows or go back?

Attaching my current form so you can check it out..I have added a bunch of code (colors page now has color picker allows user to pick custom colors to replace in the color palette, etc)

:)

Hopefully you can get 64 bit working as my best friend has 64 bit and he isnt able to use the app.
 

Attachments

  • TradeRoute 2-25-15.xlsm
    134.4 KB · Views: 17
Latest Version to use - lost of unused code removed and other fixes and quit options added and more options on the tables + saving in the code etc
 

Attachments

  • 2-25-15-3.xlsm
    145.7 KB · Views: 16
No, neither gave up nor forgot, just had a client that had a production problem.
Anyway, here is the file. I have tested on my 64bit Excel and it seems to work fine, but not sure I have tested everything - I couldn't see how the colours get changed. I have fixed the spin functionality, it should work regardless of where it is now.
One thing I really don't like is that when you click a button (box), you get no feedback. I kept clicking them multiple times as I got nothing, and inserted/deleted multiple records.
 

Attachments

  • ExcelGuru - 4118 - 2-25-15-3.xlsm
    101.5 KB · Views: 15
No, neither gave up nor forgot, just had a client that had a production problem.
Anyway, here is the file. I have tested on my 64bit Excel and it seems to work fine, but not sure I have tested everything - I couldn't see how the colours get changed. I have fixed the spin functionality, it should work regardless of where it is now.
One thing I really don't like is that when you click a button (box), you get no feedback. I kept clicking them multiple times as I got nothing, and inserted/deleted multiple records.

I was looking into that button click you mentioned too. When I originally was testing that, I had excel open in the bkg so could see what was happening. Any suggestions?

I will check the 64 bit code and much appreciated you're a rock star!

Edit: I got error here on opening
Code:
ByVal nCmdShow As Long) As Long

Says expected line number or end of statement, wait should this work in 32bit or is this one 64bit only and if they want 32bit have to use the original one?
 
Last edited:
Also don't forget to let me know how I can donate directly to you for all your time (or should I donate to site) - I asked before but not sure if you saw it..several pages back :)
 
Just remove that line. It is a superfluous line that I didn't delete, it was masked by the 64bit conditional compilation when I did it.

On the button issue, is a 1 sec wait acceptable? If so you could remove the border before calling the macro, then wait a second, then put it back. For example, BtnSave,

Code:
Private Sub BtnSave_Click()'SAVE NEW RECORD
    Me.BtnSave.BorderStyle = fmBorderStyleNone
    Call InsertRecord
    Application.Wait Now + TimeSerial(0, 0, 1)
    Me.BtnSave.BorderStyle = fmBorderStyleSingle
End Sub
 
Also don't forget to let me know how I can donate directly to you for all your time (or should I donate to site) - I asked before but not sure if you saw it..several pages back :)

If you want to donate something, not to me it has been a more worthy challenge, not to the site. You could donate to one of my favoured charities, Médecins Sans Frontières or Water Aid (or maybe get me a techie book :))
 
I will definitely look into your charities!

I commented out that line and had more erros. I'll be home shortly I will check again


Button idea is good I'll check when I get home. I'm at Walmart lol
 
I thought the button border worked quite well, a second was no big deal. I just removed that line in 32bit excel and I didn't get any errors, but I expect your testing to be better than mine.

I've never been to WalMart, never will :) (Mind you as I live in the UK that is not saying so much, although Asda is owned by Walmart).
 
I thought the button border worked quite well, a second was no big deal. I just removed that line in 32bit excel and I didn't get any errors, but I expect your testing to be better than mine.

I've never been to WalMart, never will :) (Mind you as I live in the UK that is not saying so much, although Asda is owned by Walmart).

Just got in, checking things now.

I wish I didn't hvae to go to Wal-Mart but with money so tight, to save, we have to. I hate supporting them they are not great people.

They are why my own personal business is now failing..and they pay their people crap.

I removed the line and get ambigious code (which we both know what that means)
Code:
    Public Declare Function SetLayeredWindowAttributes Lib "user32.dll" ( _
           ByVal hWnd As Long, _
           ByVal crKey As Long, _
           ByVal bAlpha As Byte, _
           ByVal dwFlags As Long) As Long

Also the CTRL ALT R macro is not working for some reason

If I comment that out I get error here
Code:
 Public hMenu As LongPtr

User defined type not defined
 
Last edited:
The border thing was great btw, I just tried it.

Also can you tell me what is the difference in me.btnSave.Borderstyle and just btnSave.Borderstyle?

64 bit no go though that file gives me so many errors!
 
Last edited:
I wasn't getting errors in 32bit nor 64bit, so can you post the workbook as you have it now, and I will check it out in both formats.
 
I didn't save my changes so I have my version and then yours that you attached above.
 
Just for the record I am attaching the one I got from you and my current one (made some font changes and added in the Border button code you gave me and also I made the buy / sell autoresize with the text..have not decided if I like that yet or not)
 

Attachments

  • Trade Route 2-28-15.xlsm
    158.4 KB · Views: 19
  • ExcelGuru - 4118 - 2-25-15-3.xlsm
    76.4 KB · Views: 14
FYI I sent the file to my friend he said it ran in 64 bit now, but it won't in 32..doh.
 
Back
Top