(I'm a bit of a beginner in writing macros - only started to learn it to prepare myself to be humiliated in the ModelOff competition :D so I hope this isn't too silly a question.. but anyway)
I inserted some bitmap images in my spreadsheet and I wanted to use macros to change the image displayed while my macro is doing other stuff in the background, so I added something like this in between my codes...
Well, it's mostly for aesthetic reasons, but anyway, it works as intended when I run it on my laptop with Excel 2007, but when I tried my spreadsheet on my PC with Excel 2010, it seems to only display the first and last images. I think my laptop runs Windows XP and my PC runs Windows 7 - I didn't get to try my spreadsheets on other machines yet.
I also tried using OFFSET in the formula of the bitmap image, and changing a value in a linked cell, which works fine with Excel 2007, but again, Excel 2010 is being a bit stubborn.
Anyone know what I can do to fix it? , or an alternative I can use to get the desired effect?
Some other info:
I also have another spreadsheet that has 20+ bitmap images, but because all the bitmap images were making my spreadsheet lag, I used a similar code to update my images only when it's really necessary, and then removing the links so my spreadsheet still can do its work decently, by having something like this in my code:
Again it works as intended in Excel 2007, but as for Excel 2010...
I could get it to work as intended (in Excel 2010) if I manually used two separate macros (I only know how to run macros by getting the user to click on a button, 2 buttons in this case - am still trying to learn how to run macros that run in the worksheet automatically - I understand you have to write the codes, but not in the module - right? Nevermind, I'll figure that out one day)
First macro from first button
Second macro from second button
--> It doesn't work if I run a macro from one button
Hope that makes sense
I inserted some bitmap images in my spreadsheet and I wanted to use macros to change the image displayed while my macro is doing other stuff in the background, so I added something like this in between my codes...
Code:
ActiveSheet.Shapes("Picture 1").Select
Selection.Formula = "Image1"
'...Codes to get Excel to wait a few seconds...
ActiveSheet.Shapes("Picture 1").Select
Selection.Formula = "Image2"
Well, it's mostly for aesthetic reasons, but anyway, it works as intended when I run it on my laptop with Excel 2007, but when I tried my spreadsheet on my PC with Excel 2010, it seems to only display the first and last images. I think my laptop runs Windows XP and my PC runs Windows 7 - I didn't get to try my spreadsheets on other machines yet.
I also tried using OFFSET in the formula of the bitmap image, and changing a value in a linked cell, which works fine with Excel 2007, but again, Excel 2010 is being a bit stubborn.
Anyone know what I can do to fix it? , or an alternative I can use to get the desired effect?
Some other info:
I also have another spreadsheet that has 20+ bitmap images, but because all the bitmap images were making my spreadsheet lag, I used a similar code to update my images only when it's really necessary, and then removing the links so my spreadsheet still can do its work decently, by having something like this in my code:
Code:
'... After an event is triggered...
For X = 1 to 10
ActiveSheet.Shapes("Picture "&X).Select
Selection.Formula = "Image"&X
Selection.Formula = ""
Next X
Again it works as intended in Excel 2007, but as for Excel 2010...
I could get it to work as intended (in Excel 2010) if I manually used two separate macros (I only know how to run macros by getting the user to click on a button, 2 buttons in this case - am still trying to learn how to run macros that run in the worksheet automatically - I understand you have to write the codes, but not in the module - right? Nevermind, I'll figure that out one day)
First macro from first button
Code:
Sub UpdatePicLinks()
For X = 1 to 10
ActiveSheet.Shapes("Picture "&X).Select
Selection.Formula = "Image"&X
Next X
End Sub
Second macro from second button
Code:
Sub RemovePicLinks()
For X = 1 to 10
ActiveSheet.Shapes("Picture "&X).Select
Selection.Formula = ""
Next X
End Sub
--> It doesn't work if I run a macro from one button
Code:
Sub UpdatePic_Button()
Application.Run ("UpdatePicLinks")
Application.Run ("RemovePicLinks")
End Sub
Hope that makes sense