Bill Benson
bensonforums at gmail.com
Wed Feb 4 22:09:37 CST 2015
It's not me with the need Dan, probably Brad you are trying to help, no? I
have *never* had trouble automating Excel. Then again possibly I have not
tried to automate excel 2013 from Ac2010. And my client is automating from
Ac2013 to Excel 2010.
My code looks similar to yours though I don't use the DoEvents because
sometimes they hurt me rather than help me. am sure. When I Googled the
error message Brad mentioned I saw some Google posts about application
level addins or plugins... so I suggested that...so maybe Brad has stumbled
across a problem with plug-ins or addins that don't like being automated. I
am eager to see what he learns.
Thanks!
> On Feb 4, 2015 6:02 PM, "Dan Waters" <df.waters at outlook.com> wrote:
>>
>> Hi Bill,
>>
>> This is what I use to open an excel file - maybe it will be helpful.
>>
>> Good Luck!
>> Dan
>>
>> --------------------------
>> Public Sub OpenExcelFile(stgSpreadsheetFullPath As String)
>>
>> Dim objExcel As Object
>> Dim objWorkbook As Object
>> ' Dim objExcel As excel.Application '-- TEST
>> ' Dim objWorkbook As excel.Workbook '-- TEST
>>
>> Application.Echo SV.ApplicationEcho
>>
>> DoEvents
>>
>> '-- Open the Excel application
>> Set objExcel = CreateObject("Excel.Application")
>>
>> DoEvents
>>
>> '-- Make the application visible
>> objExcel.Visible = True
>>
>> DoEvents
>>
>> '-- Open the workbook in the spreadsheet file
>> Set objWorkbook = objExcel.Workbooks.Open(stgSpreadsheetFullPath)
>>
>> '-- Now that the file is open to the workbook close the object
variables
>> Set objWorkbook = Nothing
>> Set objExcel = Nothing
>>
>> Application.Echo True
>>
>> End Sub
>> -------------------------------
>>
>> -----Original Message-----
>> From: accessd-bounces at databaseadvisors.com
>> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Benson
>>