Hey guys,
This is my first time posting in the forums, so I hope I'm in the right place. I'm writing this program using VBA in Excel 2007 and am somewhat experienced in VBA. I'm trying to give the user of the program an option to browse a folder, select the excel file that they want to open, and then double click it to open it. To accomplish this, I am simply using the shell function to open the folder containing the files. However, when I double click the excel file it doesn't open or do anything. I initially thought that it might be due to the file extension, so I tried changing it from a .csv file to an .xsl file, but that didn't make any difference. Based on some further experimenting, it seems like I can't open any file that should open in excel. I'm not sure if this is correct or not, but I know I was able to open a word document (in Microsoft word) using this strategy. Here is the actual code I am using:
Dim str_folder As String
str_folder = "C:\pe\ICP\Reports\"
Call Shell("explorer.exe " & str_folder, vbNormalFocus)
I really need some help figuring this one out and would really appreciate any input you guys have because I'm sure the problem isn't all that hard to figure out for an experienced VBA programmer.
Thanks in advance - Forest
This is my first time posting in the forums, so I hope I'm in the right place. I'm writing this program using VBA in Excel 2007 and am somewhat experienced in VBA. I'm trying to give the user of the program an option to browse a folder, select the excel file that they want to open, and then double click it to open it. To accomplish this, I am simply using the shell function to open the folder containing the files. However, when I double click the excel file it doesn't open or do anything. I initially thought that it might be due to the file extension, so I tried changing it from a .csv file to an .xsl file, but that didn't make any difference. Based on some further experimenting, it seems like I can't open any file that should open in excel. I'm not sure if this is correct or not, but I know I was able to open a word document (in Microsoft word) using this strategy. Here is the actual code I am using:
Dim str_folder As String
str_folder = "C:\pe\ICP\Reports\"
Call Shell("explorer.exe " & str_folder, vbNormalFocus)
I really need some help figuring this one out and would really appreciate any input you guys have because I'm sure the problem isn't all that hard to figure out for an experienced VBA programmer.
Thanks in advance - Forest