Skip to main content

Avoid adding sheetname to filename

I have the current import script:

Sub Main
Call ExcelImport()
End Sub

Function ExcelImport
Set task=Client.GetImportTask("ImportExcel")
dbName="C:\Desktop\myfile.xlsx"
task.FileToImport=dbname
task.SheetToImport="Sheet1"
task.OutputFilePRefix="Test"
task.FirstRowlsFieldName="True"
task.EmptyNumericFieldAsZero="True"
task.PerformTask
Set task=Nothing
End Function

This creates a Test-Sheet1 file, so Test-Sheet1.IMD. However, I do not want that "Sheet1" is added. I played around with it, but could not figure out how to avoid that Sheet1 is added (or some other string in case I would like to set it to something like "Sh1"). So I could not find the option to set this. How can I do this? Of course I could use a workaround later on to manipulate the file name, but this is extra work and I thought this should be possible.

Thanks for the help.

Bert_B Fri, 11/06/2020 - 06:11

Just saw you already answered, you were faster, if you want, you can delete the whole thread.

But thanks for your super fast answer!

Edit: Renaming the database? How do you mean? Like a work around to rename the filename later like in the post?

The website encountered an unexpected error. Try again later.