Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default I've been working a littlbit too long


So, I have been working for what seems like 2 and a half weeks on this
project. I know that it is not hard, but I don't really know VBA
programming stuff...

I guess this is my question... Is tehre a way to run a few lines of
code from another module(I.E.


'under the workbook that I am using this is on Sheet1

sub ActiveX_BTN_Click()

-Run Stuffier(a,b)
End Sub

'and this is under moduleX
Sub createstuff(Path,FileName)
dim xlapp as excel.application
dim wdapp as word.application
xlapp = me.application
wdapp = getobject("Word.application")

wdapp.select
wdapp.selection.copy
xlapp.paste
End Sub

I know that it's not perfect (or even working well) but I keep getting
the error

Code:
--------------------
Compile error:
Expected Function or variable
--------------------


Any one know what I'm doing wrong?


--
Adam.Effinger
------------------------------------------------------------------------
Adam.Effinger's Profile: http://www.thecodecage.com/forumz/member.php?userid=594
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=126706

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default I've been working a littlbit too long

Perhaps it is because the function is called createstuff and you are
calling Stuffier.

Other than that, use Call not Run.

--
__________________________________
HTH

Bob

"Adam.Effinger" wrote in message
...

So, I have been working for what seems like 2 and a half weeks on this
project. I know that it is not hard, but I don't really know VBA
programming stuff...

I guess this is my question... Is tehre a way to run a few lines of
code from another module(I.E.


'under the workbook that I am using this is on Sheet1

sub ActiveX_BTN_Click()

-Run Stuffier(a,b)
End Sub

'and this is under moduleX
Sub createstuff(Path,FileName)
dim xlapp as excel.application
dim wdapp as word.application
xlapp = me.application
wdapp = getobject("Word.application")

wdapp.select
wdapp.selection.copy
xlapp.paste
End Sub

I know that it's not perfect (or even working well) but I keep getting
the error

Code:
--------------------
Compile error:
Expected Function or variable
--------------------


Any one know what I'm doing wrong?


--
Adam.Effinger
------------------------------------------------------------------------
Adam.Effinger's Profile:
http://www.thecodecage.com/forumz/member.php?userid=594
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=126706



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default I've been working a littlbit too long


No, did the Stuffier because it didn't matter what I was doing really.
I just wanted to write the syntax stuff...

I'll try call. I think earlier I had realized that, but didn't commit
that to memory...

Bob Phillips;457829 Wrote:
Perhaps it is because the function is called createstuff and you are
calling Stuffier.

Other than that, use Call not Run.

--
__________________________________
HTH

Bob

"Adam.Effinger" wrote in
message
...

So, I have been working for what seems like 2 and a half weeks on

this
project. I know that it is not hard, but I don't really know VBA
programming stuff...

I guess this is my question... Is tehre a way to run a few lines of
code from another module(I.E.


'under the workbook that I am using this is on Sheet1

sub ActiveX_BTN_Click()

-Run Stuffier(a,b)
End Sub

'and this is under moduleX
Sub createstuff(Path,FileName)
dim xlapp as excel.application
dim wdapp as word.application
xlapp = me.application
wdapp = getobject("Word.application")

wdapp.select
wdapp.selection.copy
xlapp.paste
End Sub

I know that it's not perfect (or even working well) but I keep

getting
the error

Code:
--------------------
Compile error:
Expected Function or variable
--------------------


Any one know what I'm doing wrong?


--
Adam.Effinger

------------------------------------------------------------------------
Adam.Effinger's Profile:
'The Code Cage Forums - View Profile: Adam.Effinger'

(http://www.thecodecage.com/forumz/member.php?userid=594)
View this thread:
'I've been working a littlbit too long - The Code Cage Forums'

(http://www.thecodecage.com/forumz/sh...d.php?t=126706)



--
Adam.Effinger
------------------------------------------------------------------------
Adam.Effinger's Profile: http://www.thecodecage.com/forumz/member.php?userid=594
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=126706

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
held the shift key down for too long so now keyboard not working chmo Excel Discussion (Misc queries) 2 September 8th 09 10:00 PM
SumIf not working over a long range Adam Lawrence Acoustics Excel Discussion (Misc queries) 5 October 27th 08 05:20 PM
working with a long list deblars Excel Discussion (Misc queries) 2 December 20th 06 04:28 AM
Reading and working with a long CSV (more than 100K lines). [email protected] Excel Programming 2 July 13th 06 03:48 AM
Transpose Function not Working with Long Array Elements Ngan Excel Programming 1 August 9th 05 08:59 PM


All times are GMT +1. The time now is 04:49 PM.

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"