Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Convert only a particular worksheet to CSV
Hi,
I am writing a script which converts xls to csv. However, before it save / converts it to csv, it should only be selecting the correct worksheet and not whatever is shown when opened up. I have tried this Workbooks.Open fileName:=fileNames(i) ActiveWorkbook.Worksheets("wksTest").Activate ActiveWorkbook.SaveAs fileName:=Left(fileNames(i), Len(fileNames(i)) - 4) & ".csv", FileFormat:=xlCSV ActiveWorkbook.Close However it doesn't like the Activate command there. Whats wrong with it? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Convert only a particular worksheet to CSV
try select instead of activat -- Mallyca ----------------------------------------------------------------------- Mallycat's Profile: http://www.excelforum.com/member.php...fo&userid=3551 View this thread: http://www.excelforum.com/showthread.php?threadid=56233 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Convert only a particular worksheet to CSV
Select doesn't work.
It says: "Code Execution has been interrupted" Mallycat wrote: try select instead of activate -- Mallycat ------------------------------------------------------------------------ Mallycat's Profile: http://www.excelforum.com/member.php...o&userid=35514 View this thread: http://www.excelforum.com/showthread...hreadid=562338 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Convert only a particular worksheet to CSV
Dim WB As Workbook
Set WB=Workbooks.Open fileName:=fileNames(i) WB.Worksheets("wksTest").SaveAs fileName:=Left(fileNames(i), Len(fileNames(i)) - 4) & ".csv", FileFormat:=xlCSV WB.Close NickHK wrote in message oups.com... Hi, I am writing a script which converts xls to csv. However, before it save / converts it to csv, it should only be selecting the correct worksheet and not whatever is shown when opened up. I have tried this Workbooks.Open fileName:=fileNames(i) ActiveWorkbook.Worksheets("wksTest").Activate ActiveWorkbook.SaveAs fileName:=Left(fileNames(i), Len(fileNames(i)) - 4) & ".csv", FileFormat:=xlCSV ActiveWorkbook.Close However it doesn't like the Activate command there. Whats wrong with it? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I convert Quattro Pro worksheet? | Excel Discussion (Misc queries) | |||
I am trying to convert an excel worksheet to a pdf. | Excel Programming | |||
Convert currency of the whole worksheet | Excel Discussion (Misc queries) | |||
Macro to convert Name of worksheet | Setting up and Configuration of Excel | |||
Convert Worksheet to Userform | Excel Discussion (Misc queries) |