Link to home
Create AccountLog in
Avatar of intangiblemedia
intangiblemediaFlag for Afghanistan

asked on

Open CSV file, copy first cell of A1 to clipboard, delete it, save file

Hi everyone,

I am using a Macro Recorder software that allows C# scripts to be used as part of the macro.

The script I need to adapt is this:

public class Program
{
	public static void Main()
	{
		System.Windows.Forms.MessageBox.Show("DOSOMETHING");
	}
}

Open in new window


What I need the C# to do is this:
1) Open a .csv file on my PC
2) Copy the first cell, e.g. A1 to clipboard
3) Delete A1
4) Save file

Can anyone help? Would make my life easier!

Thanks,

Ben
ASKER CERTIFIED SOLUTION
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of intangiblemedia

ASKER

Thanks - does this also delete the row after its been copied to clipboard and save file?
It copies and deletes the 1st cell in the 1st line
Thank you for your post - but I have tried including it in the function above and it wont work.

I get error messages like:
"The type or namespace name "var" could not be found"
use string instead of var.
Except In the first line use string[] instead of var.