mark hansen
Well-known Member
- Joined
- Mar 6, 2006
- Messages
- 534
- Office Version
- 2016
- Platform
- Windows
I have a series of workbooks, one for each week with schedules on them. Each workbook is created from the same workbook with the only difference is the file name. Each workbook has a weekly sheet showing each day of the week and what times are booked.
Using a worksheet_SelectionChange event, I can switch to another workbook which is like switching to a different week's schedule.
During the weekly view activate event and a workbook close event, I take a picture of the weekly view worksheet to post on sharepoint, so all can see the most current schedule. (not everyone is allowed to update, they call the scheduler for that).
I only need the worksheets for "this week" and "Next week" to create the picture of the weekly view. (I may have 4-5 weeks open in the future). Through a VLOOKUP I set the value of CX9 to either "Current Week.jpg", "Next week.jpg", or NULL and use that value for the file name of the file for SharePoint.
The ExportToJPG routine has an IF OR statement:
xSheet = Range("CX9").Value
If xSheet = "Current Week.jpg" Or xSheet = "Next Week.jpg" Then
'{SAVE JPG}
Else
MsgBox "Not updating"
End If
It all works great for the Current week's workbook, but not for the Next weeks workbook. My goal is ... if CX9 is either "Current Week.jpg" or "Next week.jpg" to save the jpg file that's picked up in sharepoint. If CX9 is something else, go to the ELSE statement and display the message "Not updating" (to be removed when done).
I've stepped through the code, check the value in CX9 and it seems correct (no extra spaces, upper and lower case match)
What am I overlooking?
Mark
Using a worksheet_SelectionChange event, I can switch to another workbook which is like switching to a different week's schedule.
During the weekly view activate event and a workbook close event, I take a picture of the weekly view worksheet to post on sharepoint, so all can see the most current schedule. (not everyone is allowed to update, they call the scheduler for that).
I only need the worksheets for "this week" and "Next week" to create the picture of the weekly view. (I may have 4-5 weeks open in the future). Through a VLOOKUP I set the value of CX9 to either "Current Week.jpg", "Next week.jpg", or NULL and use that value for the file name of the file for SharePoint.
The ExportToJPG routine has an IF OR statement:
xSheet = Range("CX9").Value
If xSheet = "Current Week.jpg" Or xSheet = "Next Week.jpg" Then
'{SAVE JPG}
Else
MsgBox "Not updating"
End If
It all works great for the Current week's workbook, but not for the Next weeks workbook. My goal is ... if CX9 is either "Current Week.jpg" or "Next week.jpg" to save the jpg file that's picked up in sharepoint. If CX9 is something else, go to the ELSE statement and display the message "Not updating" (to be removed when done).
I've stepped through the code, check the value in CX9 and it seems correct (no extra spaces, upper and lower case match)
What am I overlooking?
Mark