CMORailMan
New Member
- Joined
- Jun 20, 2014
- Messages
- 2
Big Picture: I have no previous experience with VBA at all, but I'm trying to get a program that was written for a different office in the company I work at. Its purpose is to create an online PDF of photos from a designated folder in a specific format. The user just enters some information about the photos and the numbers of each photo in the corresponding excel fields and runs the program by clicking a button on the cover sheet labeled "CREATE WEBSITE PHOTOS".
Problem: I get a "Run-time error '9': Subscript out of range" error occurring at the following line of code:
The code immediately surrounding this line (with that particular line in red) is as follows:
When I hover over xlSheetVisible, I see that xlSheetVisible = -1. With my incredibly limited knowledge, I think that is a problem, but I don't see where that value comes from or what it means. I know my lack of experience may make me more difficult to help, but I'm hoping someone can help get me to the next step with troubleshooting this.
Thanks,
Chris
Problem: I get a "Run-time error '9': Subscript out of range" error occurring at the following line of code:
Rich (BB code):
Sheets("EXPORT").Visible = xlSheetVisible
The code immediately surrounding this line (with that particular line in red) is as follows:
Rich (BB code):
Sub HTML_Crossing()
Dim A As Integer
Dim B As Integer
Dim C As Integer
Dim E As Integer
Dim F As Integer
Dim LPhoto As String
Dim RPhoto As String
Dim PhotoDesc As String
Dim FileLoc As String
A = 1
B = 2
C = 1
E = 2
F = 2
Let FileLoc = Worksheets("COVER").Range("D6")
MsgBox "SAVE THIS FILE BEFORE CONTINUING PROCESSING THIS INFORMATION!", vbInformation
MsgBox "MAKE SURE " & FileLoc & " CONTAINS FOLDERS MED AND ORG", vbInformation
ActiveWorkbook.Save
Sheets("EXPORT").Visible = xlSheetVisible
Sheets("CROSSING-HTML").Visible = xlSheetVisible
Sheets("CONCADINATION").Visible = xlSheetVisible
When I hover over xlSheetVisible, I see that xlSheetVisible = -1. With my incredibly limited knowledge, I think that is a problem, but I don't see where that value comes from or what it means. I know my lack of experience may make me more difficult to help, but I'm hoping someone can help get me to the next step with troubleshooting this.
Thanks,
Chris