CF Card failure - a bit different

I have an EOS 7D that I have used for many years with the Sandisk 16GB extreme pro. Recently, the compact flash card stopped working so I contacted Sandisk and they sent me a brand new one. This new one is also not being recognized by my camera it says “Change/Remove Card of format with camera” but when I try to format it with the camera it won’t let me. The card is being read by my MacBook. The weird thing is, I have a generic 2GB compact flash which works perfectly fine and is recognized by my camera. I also went by Best Buy and purchased another Sandisk card just to try it and it also didn’t work on my camera but it does on my computer. My pins on the camera are in great condition (none are bent). If anybody knows how to resolve this or has the same problem please reply.