That's okay. I have fought this all day. I was trying to do that because I
didn't know how many columns and rows I had. The number of columns has been
completely defined and I can figure out the number of rows. A different
engineer posted a very short example showing how to do that. I saw it
yesterday but can't find it now for anything.
I have 2 of what are probably easy questions:
1.
I want the EXCEL workbook to show so I can work through all this formatting.
It is completely hidden. If I don't have EXCEL open when I do the following:
Set xlApp = GetObject(, "Excel.Application")
it gives me a run-time error '429' ActiveX component can't create object.
I may not have my references in the correct order?????
So I open EXCEL, but can't see my spreadsheet
Rest of my open routine
Set xlApp = GetObject(, "Excel.Application")
If Err.Number <> 0 Then
blnExcelWasNotRunning = True
Set xlApp = CreateObject("excel.application")
End If
Err.Clear ' Clear Err object in case error occurred.
On Error GoTo Build_XL_Report_ERR
xlApp.DisplayAlerts = True
xlApp.Interactive = True
xlApp.ScreenUpdating = True
xnm = "H:\Capital.xls"
rptnm = "Med D PMO Operating & Capital Expense Report"
Set xlBook = xlApp.Workbooks.Open(xnm, 0, True)
Set xlSheet = xlBook.Worksheets(1)
2. How do I close with save without the user having to be involved?
Thanks. I want to finish this today and those 2 issues are stopping me.