Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Run a macro always I open an Excel Document

Hi,

I need to run a macro always I open an Excel document, for exemple, a file
with extensioo .csv.
I found that if I aditioning to the Add-ins the file with the macro saved
with the extensio .xla I have what I want.
The code is write in the "Sub Workbook_Open()" to run since I open the file.
But there's a problem.

I have the code listed below...

Private Sub Workbook_Open()

Columns("A:M").Select
...
...

End Sub

I only write the first line because the problem starts here.
When the code starts to run, the workboow isn't yet open and happens the
error.
If I stop the macro and run it again, the workbook is openned and all is
right.
How can I solve this problem?

Thanks in adance.

Rui


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Run a macro always I open an Excel Document

try instead:
Range("A:M").Select
HTH


"Rui Álvares" wrote in message
...
Hi,

I need to run a macro always I open an Excel document, for exemple, a file
with extensioo .csv.
I found that if I aditioning to the Add-ins the file with the macro saved
with the extensio .xla I have what I want.
The code is write in the "Sub Workbook_Open()" to run since I open the
file. But there's a problem.

I have the code listed below...

Private Sub Workbook_Open()

Columns("A:M").Select
...
...

End Sub

I only write the first line because the problem starts here.
When the code starts to run, the workboow isn't yet open and happens the
error.
If I stop the macro and run it again, the workbook is openned and all is
right.
How can I solve this problem?

Thanks in adance.

Rui



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a macro to open another document Bex Excel Discussion (Misc queries) 1 August 17th 07 02:20 AM
Using a macro to open another document CLR Excel Discussion (Misc queries) 0 August 17th 07 01:48 AM
Macro to open specific document Thew21 Excel Discussion (Misc queries) 1 December 13th 06 01:18 PM
Open a specific Word document from an Excel Macro Canoeist Excel Programming 3 March 22nd 05 06:35 AM
macro and button to open a word document from within excel JAJOSEPHESQ Excel Programming 1 May 5th 04 06:06 AM


All times are GMT +1. The time now is 10:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"