Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi iam using a macro to export from excel
how do i set the path for that perticular excel file
can some one tell me ?
what is the command to set the path ?
and also i want to know how do we rename the workbook
whwenever i export it pops like worboo1 , workboo2
i want to rename this work book also
John,
we gave you all the informations to do this.
In your script, insert yourself where you prefer to define your path the string
filePath = "F:\myFile.xls" 'your path
and, in your export to excel sub, after your
.CopyTableToClipboard true
or
XLSheet.paste
insert string
XLDoc.SaveAs filePath
Follow this trace,
S.
Hi,
try to post a snippet.
S.
Plz find the attachment now tell me where do i mention the path here
Hi,
try this:
Sub sendToExcel
'Set the path where the excel will be saved
filePath = "F:\myFile.xls"
Set excelFile = CreateObject("Excel.Application")
excelFile.Visible = true
Set myWorkBook = excelFile.WorkBooks.Add
Set mySheet = myWorkBook.WorkSheets(1)
Set tableToExport = ActiveDocument.GetSheetObject("CH01")
Set chartProperties = tableToExport.GetProperties
tableToExport.CopyTableToClipboard true
excelFile.Visible = true
myWorkBook.SaveAs filePath
myWorkBook.Close
excelFile.Quit
Set myWorkBook = nothing
Set excelFile = nothing
End Sub
Let me know if it works.
S.
John,
did it solve your problem?
S.
HI John I tried but its not working
Iam attaching the script in a word document can u please add the file path to the scrip ,
i want to save it into D:\Export\
Guys i have already posted my code just can some one add there path . I dont know how do we add the path
John,
we gave you all the informations to do this.
In your script, insert yourself where you prefer to define your path the string
filePath = "F:\myFile.xls" 'your path
and, in your export to excel sub, after your
.CopyTableToClipboard true
or
XLSheet.paste
insert string
XLDoc.SaveAs filePath
Follow this trace,
S.
Thanks simone.spanio