ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Module 1 - Subscript out of range error (https://www.excelbanter.com/excel-programming/333019-module-1-subscript-out-range-error.html)

Craigm[_18_]

Module 1 - Subscript out of range error
 

Set wbBook = Workbooks("C:\Temp\Charts_ChgAll2.xls")
-------------------------
I moved all my macro code from "Thisworkbook" to "Module1" in the sam
workbook. The code was running before I moved it.

Now I am getting a "Subscript out of range error" on the above line?

--------------------------------------------------------------
I am strangely confused and in the deep end too.

Craig

--
Craig
-----------------------------------------------------------------------
Craigm's Profile: http://www.excelforum.com/member.php...fo&userid=2438
View this thread: http://www.excelforum.com/showthread.php?threadid=38276


ben

Module 1 - Subscript out of range error
 
that sounds to me like it just can't find the workbook, verify the location
of the workbook and that the name is not mistyped. (Also try opening it first)

--
When you lose your mind, you free your life.


"Craigm" wrote:


Set wbBook = Workbooks("C:\Temp\Charts_ChgAll2.xls")
-------------------------
I moved all my macro code from "Thisworkbook" to "Module1" in the same
workbook. The code was running before I moved it.

Now I am getting a "Subscript out of range error" on the above line?

--------------------------------------------------------------
I am strangely confused and in the deep end too.

Craigm


--
Craigm
------------------------------------------------------------------------
Craigm's Profile: http://www.excelforum.com/member.php...o&userid=24381
View this thread: http://www.excelforum.com/showthread...hreadid=382769



anilsolipuram[_119_]

Module 1 - Subscript out of range error
 

Set wbBook = Workbooks("C:\Temp\Charts_ChgAll2.xls")

for the above code to work,file Charts_ChgAll2.xls has to be opened
when running the macro , and also code should be.

Set wbBook = Workbooks("Charts_ChgAll2.xls")

make sure that file Charts_ChgAll2.xls, is kept opened before running
the macro


--
anilsolipuram
------------------------------------------------------------------------
anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
View this thread: http://www.excelforum.com/showthread...hreadid=382769



All times are GMT +1. The time now is 12:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com