ActiveWorkbook.SaveAs Range A1 problem...

guybrown

Board Regular
Joined
Jul 2, 2008
Messages
100
Hi all

A1 contains H:\FolderOne\FolderTwo\Filename.scr
A1 may be changed by users so I don't want to incorporate into code - I'd rather refer to cell A1.

ActiveWorkbook.SaveAs Filename:=Range("A1"), FileFormat:=xlTextPrinter, CreateBackup:=False

This code doesn't seem to work. Any help much appreciated.

Guy, XP prof, XL 2007
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
In what way doesn't it work? Maybe you need the Value property:

Code:
ActiveWorkbook.SaveAs Filename:=Range("A1").Value, FileFormat:=xlTextPrinter, CreateBackup:=False

You may also need to qualify the range with its worksheet, eg:

Filename:=ThisWorkbook.Worksheets("Sheet1").Range("A1").Value
 
Upvote 0
Legend! Again I'm overlooking the simpler things... The macro changed sheets so you're right - I had to reference back to Sheet1. Thanks!
 
Upvote 0

Forum statistics

Threads
1,215,771
Messages
6,126,799
Members
449,337
Latest member
BBV123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top