Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default which declaration to use

I have a very strange problem.

I created a little program, which adds worksheets and give it the sam
lay-out every time.
I did this in my personal macro workmap.
The program copies one or two pages of this personal workmap to a ne
sheet.

Now the strange thing is, that on one computer this program doesn'
give any problems. It simply copies everything (values, format, border
- everything!) and paste the selection exactly where I want it.
But now I want to let this same program work on another computer, bu
now suddenly it won't work. Visual basic starts complaining that what
want is out of the scope of my project!
I tried to solve this by making the sub public instead of private, bu
still it won't work! And still on the other computer it does work, n
matter private or public. I looked almost everywhere for differences
but I can't find any!

What is wrong? I'm going slightly mad!

tnx in advance for any help,

Pee

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default which declaration to use

I am guessing the Out of Scope could mean Subscript Out of Range (error 9).


If so, I suspect you have code like

Workbooks("mybook1")

Change it to

Workbooks("Mybook1.xls")

in all cases and it should work on both machines. The first format only
works if you have a certain windows setting (I believe hide known
extensions). The latter works in all cases.

--
Regards,
Tom Ogilvy


"Peer " wrote in message
...
I have a very strange problem.

I created a little program, which adds worksheets and give it the same
lay-out every time.
I did this in my personal macro workmap.
The program copies one or two pages of this personal workmap to a new
sheet.

Now the strange thing is, that on one computer this program doesn't
give any problems. It simply copies everything (values, format, borders
- everything!) and paste the selection exactly where I want it.
But now I want to let this same program work on another computer, but
now suddenly it won't work. Visual basic starts complaining that what I
want is out of the scope of my project!
I tried to solve this by making the sub public instead of private, but
still it won't work! And still on the other computer it does work, no
matter private or public. I looked almost everywhere for differences,
but I can't find any!

What is wrong? I'm going slightly mad!

tnx in advance for any help,

Peer


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default which declaration to use

Peer,

Exactly what does the error message say, and on what line of code
is the compiler complaining?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Peer " wrote in message
...
I have a very strange problem.

I created a little program, which adds worksheets and give it

the same
lay-out every time.
I did this in my personal macro workmap.
The program copies one or two pages of this personal workmap to

a new
sheet.

Now the strange thing is, that on one computer this program

doesn't
give any problems. It simply copies everything (values, format,

borders
- everything!) and paste the selection exactly where I want

it.
But now I want to let this same program work on another

computer, but
now suddenly it won't work. Visual basic starts complaining

that what I
want is out of the scope of my project!
I tried to solve this by making the sub public instead of

private, but
still it won't work! And still on the other computer it does

work, no
matter private or public. I looked almost everywhere for

differences,
but I can't find any!

What is wrong? I'm going slightly mad!

tnx in advance for any help,

Peer


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default which declaration to use

Thank you, Tom

that was indeed the solution.

It was a bit frustrating to see how simple the solution was after al
my searching, which is off course my own fault.

Strange thing is that I thought of this solution and I tried it (onl
in excel, now I also have selected the option in windows!). I guess
tried it to fast and went on with another "solution".

Anyway,
Thanks again!

Pee

--
Message posted from http://www.ExcelForum.com

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
Array Declaration. apis Excel Discussion (Misc queries) 1 November 5th 11 01:53 PM
Workbook Declaration Varne Excel Discussion (Misc queries) 3 April 29th 08 09:49 AM
VBA - variable declaration Jeff Excel Discussion (Misc queries) 3 January 9th 08 12:45 PM
Declaration? TJF[_2_] Excel Programming 5 December 18th 03 03:26 PM
Variable Declaration?? Tom Ogilvy Excel Programming 1 August 8th 03 06:45 PM


All times are GMT +1. The time now is 06:07 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"