Help!!!
I am trying to access excel files from a list box. The following code has been tested and I am encountering an error on the last line of code.
Private Sub cmdOpenExcel_click()
Dim xlApp As Object
Set xlApp = CreateObject("excel.application")
xlApp.Visible = True
xlApp.Open = lstExport.Text 'NAME OF THE LIST BOX'
This process should allow a user to click a command button and copy whatever files are documented within a list box.
For example
1.xls
2.xls
3.xls
The listbox(lstExport) will contain the file names listed above. The user will click on a command button and the process should open excel, open 1.xls, and copy the first six sheets from 1.xls into the first six sheets of a file called testload.xls. A macro within the testload.xls file will upload this info into a another system. Then the second file called 2.xls will open and the first 6 six sheets of that file will be copied into the first 6 sheets of testload.xls (copy paste method or ?????), overwritting the contents from the first file, and so on.
Help!!!!!!!!


Reply With Quote