Jump to content

AutoIt Excel file Save as


ilona
 Share

Recommended Posts

Hello ,

please help me with an autoit script for Excel file "save as" where the file name is range ("D2") from Activesheet

something like

 $filename = $Workbook.Activesheet.Range("D2")
   

    _Excel_BookSaveAs($Workbook,"C:\desktop\$filename.xls"   

 

Thank you!!!

Link to comment
Share on other sites

Where is your problem? Use _Excel_RangeRead to get the path and then the save function.

Edited by Xenobiologist

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

2 minutes ago, ilona said:

Thank You! 

No problem. Easy one and glad I could help.

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Sorry I can't put the path in the file name. The file is saved a ($sResult.xls ).I cant create the link with  the excel range read

Thank you

 

#include <excel.au3>


Local $oExcel = ObjGet("","Excel.Application")

if NOT @error then
  for $Workbook in $oExcel.Workbooks
  Local $sResult = _Excel_RangeRead($Workbook, Default, "D2",3)

    

    _Excel_BookSaveAs($Workbook,"C:\desktop\($sResult).xls"   )
  next
  _Excel_Close($oExcel,true,true)
EndIf

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...