View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Scott Bass[_3_] Scott Bass[_3_] is offline
external usenet poster
 
Posts: 18
Default Save All Worksheets as CSV

On Nov 10, 8:53*am, Dave Peterson wrote:
#1. *If you're using xl2003 or below (or can live with the menus under the addin
group of the ribbon in xl2007+), then use the link that points at Debra
Dalgleish's site to create a separate workbook that contains this macro and
creates the toolbar.

If you're using xl2007, you can use the code at Ron de Bruin's site to modify
the ribbon.

After you have that created, you can tell the user to store that file (DO NOT
NAME IT PERSONAL.*) in their XLStart folder.

#2. *See #1.

#3. *See #1.

I wouldn't expect most users to manage the macro by copying it into their
personal.xl* workbook.

On 11/09/2010 14:25, Scott Bass wrote:
<<snipped



Hi Dave,


What I want to do is set this up for *very* non-technical users. *In a
word description:


1. *"Copy this macro to your XLSTART\personal.xls file".


2. *"If you want this macro to run automatically when you save the
file, copy this (one-liner) code to your current workbook". *(This
would just be a short "one-liner" call to the main macro".


3. *"Otherwise, if you want to manually execute this macro, press Alt-
F8 then select the macro".


I assume #1 is covered by your code above. *I don't know how to code
#2. *Most of the time, auto-executing the macro whenever the workbook
is saved is the desired approach.


Thanks for the help...


Scott


--
Dave Peterson


I've got the macro working if I 1) create it in my autostart workbook,
and 2) call it with Alt-F8.

However, if I want to call it automatically whenever I save the
workbook, I can't get it to work.

I've tried:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
SaveAllAsCSV2
End Sub

and

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
SaveAllAsCSV2()
End Sub

and

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Call SaveAllAsCSV2
End Sub

but they all end in

Sub or Function not found.

How can I bind the autostart subroutine to the Workbook_BeforeSave
event?

Thanks,
Scott