The workbook opens but nothing happens. I look back at my Access code and I see the error "Method 'Open' of object 'Workbooks' failed", run-time error -2147417851.
Thanks for your help.
Okay, here's all the code. The Sub cmdFormatRpts_click procedure calls the fixXLS function to format the spreadsheet and walks through the records table that has the attachment names.
Option Compare Database
Private Sub cmdFormatRpts_Click()
Dim intRecordCount As Integer
Dim SQL As String...
Not sure what else you need from me. I guess I'll purchase a book. Just can't understand why it works under AccessXP and not 2007 unless it's something with Excel 2007.
My bad!!! On closer review and stepping through the code, it opens the file but still hangs on the "Method 'Open' of object 'Workbooks' failed", run-time error -2147417851.
Okay, looks like we are almost there. I can see the file opens and the formatting takes place but the file does not close so it can go to the next spreadsheet to format.
Here it is. It's bombing on the 'GetObject(mySheetPath)
Function fixXLS(mySheetPath)
Dim xl As Excel.Application
Dim XlBooks As Excel.Workbook
Dim XlSheets As Excel.Worksheet
Set xl = CreateObject("Excel.application")
Set XlBooks = GetObject(mySheetPath)
Set XlSheets...
\\ga-13025-fs\reports\attached names.xls"
I've tried it with the new Excel format also using .xlsx extension. I have about 40 different spreadsheets in that location and my code walks through an Access table and formats each of the spreadsheets. I would hate to have to do this manually.
I had the function below working in AccessXP but it no longer works in Access 2007. I get an error that says it can't create object. Any suggestions??
Function fixXLS(mySheetPath)
Set Xl = CreateObject("Excel.application")
Set Xlbook = GetObject(mySheetPath)
Xl.Visible =...
I don't know any other way to explain it because I don't know why it's happening. I have a database that emails a series of spreadsheets. Some of those spreadsheets have the data in reverse video and some don't. It's not happening now with the new queries I create for the sendobject but...
When I am sending a query object in an e-mail in Excel format, the data resulting Excel file appears to be in reverse video. I have to open each file and change the font color so it's readable. I'm not sure when this happened but it only affected the queries I created during a certain time...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.