We currently receive files from a client that are automatically copied to a folder on the server. There are two types of files, 1) Gets imported into the table 2) Gets imported into a temporary table and the main table is updated from this.
Where I'm having the issue is that I can tell the...
oXL.ActiveWorkBook.RunAutoMacros xlAutoOpen ---------------------------
Error: RunAutoMacros method of Workbook class failed
Code: 800A03EC
Source: Microsoft Office Excel
---------------------------
Do I need to reference the hidden sheet to run this macro?
Its on a sheet called Macro1
OK some progress
It appears that the macro doesn't fire when opening via this script, but it fires automatically when the file is opened manually, any ideas?
Dim oXL
Dim oFolder
Dim aFile
Dim FSO
Set oXL = CreateObject("Excel.Application")
Set FSO = CreateObject("Scripting.FileSystemObject")
oXL.DefaultFilePath = "C:\DataFiles\NewFiles"
oXL.DisplayAlerts = False
if FSO.FolderExists(oXL.DefaultFilePath)...
if FSO.FolderExists(oXL.DefaultFilePath) then
Set oFolder = FSO.GetFolder(oXL.DefaultFilePath)
For each aFile in oFolder.Files
If Right(LCase(aFile.Name), 4) = ".xls" Then
oXL.Workbooks.Open(aFile.Name)
oXL.Visible = True...
The part I don't know how to do is get the filename. Ive got a few examples I've found that show how to create the excel object but I can't seem to find any help on how to get the filename (changes so I can't hard code it).
' Create an Excel instance
Dim myExcelWorker
Set myExcelWorker =...
I have a situation with a client, they receive an excel file from a 3rd party as a mail attachement, this file is saved to a particular directory and then imported into SQL using SSIS. The problem occurs however that the 3rd party has an Excel version 4.0 formatting macro embedded in the file...
Well I was kind of hoping there is a way in Windows Scripting Host to open and save the excel file, and I can add this script to a task schedule before running the SSIS task.
I have a situation with a client, they receive an excel file from a 3rd party as a mail attachement, this file is saved to a particular directory and then imported into SQL using SSIS. The problem occurs however that the 3rd party has an Excel version 4.0 formatting macro embedded in the file...
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.