• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Run macros from other workbooks

hello
i have a main wb (wb1)
and 9 workbooks (wb2 wb3 etg.) from wb1 i run a macro (macro1) that open wb2 save as pdf and close.then the same i do to wb2. i run macro2 that open wb2 save as pdf and close. my problem is that i want to run all macros form macro1 until macro9 with a major macro that call all that macro one by one
but in the macro2 is stopped. i think the problem is that when the wb2 is opened then does not return to wb1, not activate. i try sοme macros to activate the wb1 but not succeed
any help?
 
Last edited:
kingcashandcarry
... of course You could use same terms (ex macro1) with Your 'wb1' or how?
ex from wb1 i run a macro (macro1) that open wb2 save as pdf and close.then the same i do to wb2. i run macro2 that open wb2 save as pdf and close.
Which macro would be 'macro1' and so on?
Or at least, You would write 'what would You like to do?'
 
I manage to do what i wanted writing and deleting codes and after many tries
now in the procedure i have another problem. my wbs have many pictures that are import as file paths and not pictures insert to worksheets. something like a shortcut if you understand what i mean. many times in the extracted PDF the images are blank.i don't understand why.i upload the excel and the PDF.
 

Attachments

  • 7.BAZAAR_Compressed.pdf
    261.5 KB · Views: 2
  • 7.BAZAAR.xlsm
    641.2 KB · Views: 2
Yes the full path is in cells ab35 and below the images put in z35 and below
and then copied in cells at the main table a1:x35. the thing is the much of the extracted pdf is good.for example the extracted PDF is 30 pages. 27 of them are good with right images and in2 or 3 pages i have that phenomenon without a pattern of doing that
 
kingcashandcarry
on more time...
I tried to ask that You would check (verify) pic-values are correct, NOT where are those.
If pic-values are correct then
have You checked that, there are those 'missing pictures'?
Screen Shot 2017-12-15 at 13.23.39.png
 
thats why i upload the excel.as it seems the pictures are in the sheets in the cell as i wish but it doesn't show in the pdf. and it's not the same pictures.every time i do the extract to pdf there is other missing pictures. i have 9 like that wb and 9 pdf .4 of them are big more than 10 pages . in that pdf are the problem. i mean as bigger the pdf is so the problem is
 
sorry my friend and thank you for your time.. i don't understand your questions as you can't understand mine. but thank you for your try. i will wait from someone else any help and keep searching.
 
I can understand You texts but for me those won't help!
If You cannot understand question, please ask more details of that.
Screen Shot 2017-12-15 at 13.23.39.png
If You have gotten 'message' as above then I would check first those cases.

This could do step-by-step to find where is Your challenge like:
1) pic -value has to be correct
>> You should even run code step-by-step to verify that at least those 'challenge' pictures pic-values are correct!

2) There have to be correct file for each pic!
>> ... and same with files.
Have You checked that there are those 'challenge' files?

If both those are okay then there would be something else...
 
Sorry for the delay of answering.i was making several tests and research in internet. yes "pic -value has to be correct " all correct for each pic. there are not 'challenge' files because each time are different pictures. i think the problem is not in the code but in the running of the macro. if i run macro from wb2 directly i don't have that problem. i tried to make it slowly so to display the images properly before the extraction to pdf but didn't work. now i am looking the message "
This image cannot currently be displayed" that is on the blanc images of the pdf.
 
there are not 'challenge' files because each time are different pictures.
... so, did You verify that at least those Your 'challenge picture'-files are there and with same file-name?
Even one character difference would cause Your case!
if i run macro from wb2 directly i don't have that problem.
What is different between wb2 and other way?
Are those codes exact same as well as data?
 
... so, did You verify that at least those Your 'challenge picture'-files are there and with same file-name?"
yes my files are stable and don't change and this is an information that i didn't mention because i didn't think about it, but maybe can answer your question in some way. my pictures are stored in a network folder z: . but i can't change it from that network folder it is all dependable to sharing . in the other hand i could make a try to make a test moving to a local folder but means that i have to copy files and change many codes. but it might shows if the problem is the networking or not.
for your second question sorry i was wrong. i run some files again directly from wb2 and the same problem showed up
 
Do You know which picture don't come to PDF? Yes or No?
If 'No' then find out and
after that continue ...
Have You checked that those files (from code) are somewhere correct place?
The whole pic-value have to be same as the full path with file name!
Again: Even one character difference would cause Your case!
So far, no matter, where are those, but those have to match!
Are all files in same folder?
If no then, do You have [same, enough] rights to [all] those folders?
 
Ok never mind. now i have something else that i am looking for i am trying to write a code to ungroup objects and shapes in specific range a1:ah1 in all sheets of workbook. i can't make it work because each group has another name.
 
i am coming back with my problem. i have figure out whats the problem is and i found the solution. but i can use it in a code.i have this code
[/Sub Savealltopdf()


Dim SaveAsStr As String

SaveAsStr = ActiveWorkbook.Path & "\" & ActiveSheet.Range("Af2").Value

Dim x As Integer

ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, filename:=SaveAsStr & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties _
:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub/]
but when i use it in the extracted pdf there are pictures saying "this image cannot currently be displayed "
but if the same workbook i save it as pdf and in the options i choose publish what: entire workbook the the extracted pdf is just perfect.
what i am doing wrong?
 

Attachments

  • right.jpg
    right.jpg
    82.7 KB · Views: 0
  • wrong.jpg
    wrong.jpg
    38.6 KB · Views: 1
Last edited:
Back
Top